Skip to content

Commit 505e44b

Browse files
chore: Release 4.6.0 [skip ci]
1 parent 880a3c0 commit 505e44b

File tree

2 files changed

+23
-11
lines changed

2 files changed

+23
-11
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+
## [4.6.0](https://github.com/amannn/action-semantic-pull-request/compare/v4.5.0...v4.6.0) (2022-09-26)
4+
5+
6+
### Features
7+
8+
* Provide error messages as `outputs.error_message` ([#194](https://github.com/amannn/action-semantic-pull-request/issues/194)) ([880a3c0](https://github.com/amannn/action-semantic-pull-request/commit/880a3c061c0dea01e977cefe26fb0e0d06b3d1a9))
9+
310
## [4.5.0](https://github.com/amannn/action-semantic-pull-request/compare/v4.4.0...v4.5.0) (2022-05-04)
411

512

dist/index.js

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35922,6 +35922,7 @@ module.exports = function parseConfig() {
3592235922
/***/ 3661:
3592335923
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
3592435924

35925+
const core = __nccwpck_require__(2186);
3592535926
const conventionalCommitsConfig = __nccwpck_require__(5844);
3592635927
const conventionalCommitTypes = __nccwpck_require__(614);
3592735928
const parser = __nccwpck_require__(1655).sync;
@@ -35976,30 +35977,29 @@ module.exports = async function validatePrTitle(
3597635977
}
3597735978

3597835979
if (!result.type) {
35979-
throw new Error(
35980+
raiseError(
3598035981
`No release type found in pull request title "${prTitle}". Add a prefix to indicate what kind of release this pull request corresponds to. For reference, see https://www.conventionalcommits.org/\n\n${printAvailableTypes()}`
3598135982
);
3598235983
}
3598335984

3598435985
if (!result.subject) {
35985-
throw new Error(`No subject found in pull request title "${prTitle}".`);
35986+
raiseError(`No subject found in pull request title "${prTitle}".`);
3598635987
}
3598735988

3598835989
if (!types.includes(result.type)) {
35989-
throw new Error(
35990+
raiseError(
3599035991
`Unknown release type "${
3599135992
result.type
3599235993
}" found in pull request title "${prTitle}". \n\n${printAvailableTypes()}`
3599335994
);
3599435995
}
3599535996

3599635997
if (requireScope && !result.scope) {
35997-
let msg = `No scope found in pull request title "${prTitle}".`;
35998+
let message = `No scope found in pull request title "${prTitle}".`;
3599835999
if (scopes) {
35999-
msg += ` Use one of the available scopes: ${scopes.join(', ')}.`;
36000+
message += ` Use one of the available scopes: ${scopes.join(', ')}.`;
3600036001
}
36001-
36002-
throw new Error(msg);
36002+
raiseError(message);
3600336003
}
3600436004

3600536005
const givenScopes = result.scope
@@ -36008,7 +36008,7 @@ module.exports = async function validatePrTitle(
3600836008

3600936009
const unknownScopes = givenScopes ? givenScopes.filter(isUnknownScope) : [];
3601036010
if (scopes && unknownScopes.length > 0) {
36011-
throw new Error(
36011+
raiseError(
3601236012
`Unknown ${
3601336013
unknownScopes.length > 1 ? 'scopes' : 'scope'
3601436014
} "${unknownScopes.join(
@@ -36023,7 +36023,7 @@ module.exports = async function validatePrTitle(
3602336023
? givenScopes.filter(isDisallowedScope)
3602436024
: [];
3602536025
if (disallowScopes && disallowedScopes.length > 0) {
36026-
throw new Error(
36026+
raiseError(
3602736027
`Disallowed ${
3602836028
disallowedScopes.length === 1 ? 'scope was' : 'scopes were'
3602936029
} found: ${disallowScopes.join(', ')}`
@@ -36037,8 +36037,7 @@ module.exports = async function validatePrTitle(
3603736037
title: prTitle
3603836038
});
3603936039
}
36040-
36041-
throw new Error(message);
36040+
raiseError(message);
3604236041
}
3604336042

3604436043
if (subjectPattern) {
@@ -36057,6 +36056,12 @@ module.exports = async function validatePrTitle(
3605736056
);
3605836057
}
3605936058
}
36059+
36060+
function raiseError(message) {
36061+
core.setOutput('error_message', message);
36062+
36063+
throw new Error(message);
36064+
}
3606036065
};
3606136066

3606236067

0 commit comments

Comments
 (0)