Skip to content

Commit b6bca70

Browse files
chore: Release 5.1.0 [skip ci]
1 parent 403a6f8 commit b6bca70

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## [5.1.0](https://github.com/amannn/action-semantic-pull-request/compare/v5.0.2...v5.1.0) (2023-02-10)
4+
5+
6+
### Features
7+
8+
* Add regex support to `scope` and `disallowScopes` configuration ([#226](https://github.com/amannn/action-semantic-pull-request/issues/226)) ([403a6f8](https://github.com/amannn/action-semantic-pull-request/commit/403a6f89242a0d0d3acde94e6141b2e0f4da8838))
9+
310
### [5.0.2](https://github.com/amannn/action-semantic-pull-request/compare/v5.0.1...v5.0.2) (2022-10-17)
411

512

dist/index.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37430,11 +37430,14 @@ module.exports = async function validatePrTitle(
3743037430
}
3743137431

3743237432
function isUnknownScope(s) {
37433-
return scopes && !scopes.includes(s);
37433+
return scopes && !scopes.some((scope) => new RegExp(`^${scope}$`).test(s));
3743437434
}
3743537435

3743637436
function isDisallowedScope(s) {
37437-
return disallowScopes && disallowScopes.includes(s);
37437+
return (
37438+
disallowScopes &&
37439+
disallowScopes.some((scope) => new RegExp(`^${scope}$`).test(s))
37440+
);
3743837441
}
3743937442

3744037443
if (!result.type) {
@@ -37458,7 +37461,7 @@ module.exports = async function validatePrTitle(
3745837461
if (requireScope && !result.scope) {
3745937462
let message = `No scope found in pull request title "${prTitle}".`;
3746037463
if (scopes) {
37461-
message += ` Use one of the available scopes: ${scopes.join(', ')}.`;
37464+
message += ` Scope must match one of: ${scopes.join(', ')}.`;
3746237465
}
3746337466
raiseError(message);
3746437467
}
@@ -37474,7 +37477,7 @@ module.exports = async function validatePrTitle(
3747437477
unknownScopes.length > 1 ? 'scopes' : 'scope'
3747537478
} "${unknownScopes.join(
3747637479
','
37477-
)}" found in pull request title "${prTitle}". Use one of the available scopes: ${scopes.join(
37480+
)}" found in pull request title "${prTitle}". Scope must match one of: ${scopes.join(
3747837481
', '
3747937482
)}.`
3748037483
);
@@ -37487,7 +37490,7 @@ module.exports = async function validatePrTitle(
3748737490
raiseError(
3748837491
`Disallowed ${
3748937492
disallowedScopes.length === 1 ? 'scope was' : 'scopes were'
37490-
} found: ${disallowScopes.join(', ')}`
37493+
} found: ${disallowedScopes.join(', ')}`
3749137494
);
3749237495
}
3749337496

0 commit comments

Comments
 (0)