Skip to content

Commit

Permalink
chore: Release 3.3.0 [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
semantic-release-bot committed Feb 10, 2021
1 parent d6aabb6 commit 3301e0e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## [3.3.0](https://github.com/amannn/action-semantic-pull-request/compare/v3.2.6...v3.3.0) (2021-02-10)


### Features

* Add ability to use multiple scopes ([#85](https://github.com/amannn/action-semantic-pull-request/issues/85)) ([d6aabb6](https://github.com/amannn/action-semantic-pull-request/commit/d6aabb6fedc5f57cec60b16db8595a92f1e263ab))

### [3.2.6](https://github.com/amannn/action-semantic-pull-request/compare/v3.2.5...v3.2.6) (2021-01-25)


Expand Down
18 changes: 14 additions & 4 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33458,6 +33458,10 @@ module.exports = async function validatePrTitle(
.join('\n')}`;
}

function isUnknownScope(s) {
return scopes && !scopes.includes(s);
}

if (!result.type) {
throw new Error(
`No release type found in pull request title "${prTitle}". Add a prefix to indicate what kind of release this pull request corresponds to (see https://www.conventionalcommits.org/).\n\n${printAvailableTypes()}`
Expand All @@ -33484,11 +33488,17 @@ module.exports = async function validatePrTitle(
);
}

if (scopes && result.scope && !scopes.includes(result.scope)) {
const givenScopes = result.scope
? result.scope.split(',').map((scope) => scope.trim())
: undefined;
const unknownScopes = givenScopes ? givenScopes.filter(isUnknownScope) : [];
if (scopes && unknownScopes.length > 0) {
throw new Error(
`Unknown scope "${
result.scope
}" found in pull request title "${prTitle}". Use one of the available scopes: ${scopes.join(
`Unknown ${
unknownScopes.length > 1 ? 'scopes' : 'scope'
} "${unknownScopes.join(
','
)}" found in pull request title "${prTitle}". Use one of the available scopes: ${scopes.join(
', '
)}.`
);
Expand Down

0 comments on commit 3301e0e

Please sign in to comment.