File tree Expand file tree Collapse file tree 2 files changed +29
-2
lines changed Expand file tree Collapse file tree 2 files changed +29
-2
lines changed Original file line number Diff line number Diff line change 11# Changelog
22
3+ ## [ 4.3.0] ( https://github.com/amannn/action-semantic-pull-request/compare/v4.2.0...v4.3.0 ) (2022-04-13)
4+
5+
6+ ### Features
7+
8+ * 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 ) )
9+
310## [ 4.2.0] ( https://github.com/amannn/action-semantic-pull-request/compare/v4.1.0...v4.2.0 ) (2022-02-08)
411
512
Original file line number Diff line number Diff line change @@ -35662,7 +35662,8 @@ module.exports = async function run() {
3566235662 subjectPatternError,
3566335663 validateSingleCommit,
3566435664 validateSingleCommitMatchesPrTitle,
35665- githubBaseUrl
35665+ githubBaseUrl,
35666+ ignoreLabels
3566635667 } = parseConfig();
3566735668
3566835669 const client = github.getOctokit(process.env.GITHUB_TOKEN, {
@@ -35689,6 +35690,19 @@ module.exports = async function run() {
3568935690 pull_number: contextPullRequest.number
3569035691 });
3569135692
35693+ // Ignore errors if specified labels are added.
35694+ if (ignoreLabels) {
35695+ const labelNames = pullRequest.labels.map((label) => label.name);
35696+ for (const labelName of labelNames) {
35697+ if (ignoreLabels.includes(labelName)) {
35698+ core.info(
35699+ `Validation was skipped because the PR label "${labelName}" was found.`
35700+ );
35701+ return;
35702+ }
35703+ }
35704+ }
35705+
3569235706 // Pull requests that start with "[WIP] " are excluded from the check.
3569335707 const isWip = wip && /^\[WIP\]\s/.test(pullRequest.title);
3569435708
@@ -35854,6 +35868,11 @@ module.exports = function parseConfig() {
3585435868 githubBaseUrl = ConfigParser.parseString(process.env.INPUT_GITHUBBASEURL);
3585535869 }
3585635870
35871+ let ignoreLabels;
35872+ if (process.env.INPUT_IGNORELABELS) {
35873+ ignoreLabels = ConfigParser.parseEnum(process.env.INPUT_IGNORELABELS);
35874+ }
35875+
3585735876 return {
3585835877 types,
3585935878 scopes,
@@ -35863,7 +35882,8 @@ module.exports = function parseConfig() {
3586335882 subjectPatternError,
3586435883 validateSingleCommit,
3586535884 validateSingleCommitMatchesPrTitle,
35866- githubBaseUrl
35885+ githubBaseUrl,
35886+ ignoreLabels
3586735887 };
3586835888};
3586935889
You can’t perform that action at this time.
0 commit comments