Skip to content

Commit

Permalink
chore: Release 4.6.0 [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
semantic-release-bot committed Sep 26, 2022
1 parent 880a3c0 commit 505e44b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 11 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,12 @@
# Changelog

## [4.6.0](https://github.com/amannn/action-semantic-pull-request/compare/v4.5.0...v4.6.0) (2022-09-26)


### Features

* 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))

## [4.5.0](https://github.com/amannn/action-semantic-pull-request/compare/v4.4.0...v4.5.0) (2022-05-04)


Expand Down
27 changes: 16 additions & 11 deletions dist/index.js
Expand Up @@ -35922,6 +35922,7 @@ module.exports = function parseConfig() {
/***/ 3661:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {

const core = __nccwpck_require__(2186);
const conventionalCommitsConfig = __nccwpck_require__(5844);
const conventionalCommitTypes = __nccwpck_require__(614);
const parser = __nccwpck_require__(1655).sync;
Expand Down Expand Up @@ -35976,30 +35977,29 @@ module.exports = async function validatePrTitle(
}

if (!result.type) {
throw new Error(
raiseError(
`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()}`
);
}

if (!result.subject) {
throw new Error(`No subject found in pull request title "${prTitle}".`);
raiseError(`No subject found in pull request title "${prTitle}".`);
}

if (!types.includes(result.type)) {
throw new Error(
raiseError(
`Unknown release type "${
result.type
}" found in pull request title "${prTitle}". \n\n${printAvailableTypes()}`
);
}

if (requireScope && !result.scope) {
let msg = `No scope found in pull request title "${prTitle}".`;
let message = `No scope found in pull request title "${prTitle}".`;
if (scopes) {
msg += ` Use one of the available scopes: ${scopes.join(', ')}.`;
message += ` Use one of the available scopes: ${scopes.join(', ')}.`;
}

throw new Error(msg);
raiseError(message);
}

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

const unknownScopes = givenScopes ? givenScopes.filter(isUnknownScope) : [];
if (scopes && unknownScopes.length > 0) {
throw new Error(
raiseError(
`Unknown ${
unknownScopes.length > 1 ? 'scopes' : 'scope'
} "${unknownScopes.join(
Expand All @@ -36023,7 +36023,7 @@ module.exports = async function validatePrTitle(
? givenScopes.filter(isDisallowedScope)
: [];
if (disallowScopes && disallowedScopes.length > 0) {
throw new Error(
raiseError(
`Disallowed ${
disallowedScopes.length === 1 ? 'scope was' : 'scopes were'
} found: ${disallowScopes.join(', ')}`
Expand All @@ -36037,8 +36037,7 @@ module.exports = async function validatePrTitle(
title: prTitle
});
}

throw new Error(message);
raiseError(message);
}

if (subjectPattern) {
Expand All @@ -36057,6 +36056,12 @@ module.exports = async function validatePrTitle(
);
}
}

function raiseError(message) {
core.setOutput('error_message', message);

throw new Error(message);
}
};


Expand Down

0 comments on commit 505e44b

Please sign in to comment.