Skip to content

Commit

Permalink
chore: Release 4.3.0 [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
semantic-release-bot committed Apr 13, 2022
1 parent 277c230 commit b401171
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## [4.3.0](https://github.com/amannn/action-semantic-pull-request/compare/v4.2.0...v4.3.0) (2022-04-13)


### Features

* Add `ignoreLabels` option to opt-out of validation for certain PRs ([#174](https://github.com/amannn/action-semantic-pull-request/issues/174)) ([277c230](https://github.com/amannn/action-semantic-pull-request/commit/277c2303f965680aed7613eb512365c58aa92b6b))

## [4.2.0](https://github.com/amannn/action-semantic-pull-request/compare/v4.1.0...v4.2.0) (2022-02-08)


Expand Down
24 changes: 22 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35662,7 +35662,8 @@ module.exports = async function run() {
subjectPatternError,
validateSingleCommit,
validateSingleCommitMatchesPrTitle,
githubBaseUrl
githubBaseUrl,
ignoreLabels
} = parseConfig();

const client = github.getOctokit(process.env.GITHUB_TOKEN, {
Expand All @@ -35689,6 +35690,19 @@ module.exports = async function run() {
pull_number: contextPullRequest.number
});

// Ignore errors if specified labels are added.
if (ignoreLabels) {
const labelNames = pullRequest.labels.map((label) => label.name);
for (const labelName of labelNames) {
if (ignoreLabels.includes(labelName)) {
core.info(
`Validation was skipped because the PR label "${labelName}" was found.`
);
return;
}
}
}

// Pull requests that start with "[WIP] " are excluded from the check.
const isWip = wip && /^\[WIP\]\s/.test(pullRequest.title);

Expand Down Expand Up @@ -35854,6 +35868,11 @@ module.exports = function parseConfig() {
githubBaseUrl = ConfigParser.parseString(process.env.INPUT_GITHUBBASEURL);
}

let ignoreLabels;
if (process.env.INPUT_IGNORELABELS) {
ignoreLabels = ConfigParser.parseEnum(process.env.INPUT_IGNORELABELS);
}

return {
types,
scopes,
Expand All @@ -35863,7 +35882,8 @@ module.exports = function parseConfig() {
subjectPatternError,
validateSingleCommit,
validateSingleCommitMatchesPrTitle,
githubBaseUrl
githubBaseUrl,
ignoreLabels
};
};

Expand Down

0 comments on commit b401171

Please sign in to comment.