Skip to content

Commit 69b34c1

Browse files
committed
feat(danger): Allow skipping changelog with label
This allows skipping the danger changelog check with a `skip-changelog` label in addition to `#skip-changelog` in the PR description. To make sure this triggers properly, the `danger` workflow should be run on a PR being `labeled` and `unlabeled`.
1 parent 831aefe commit 69b34c1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

danger/dangerfile.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ async function checkChangelog() {
6969
// Check if skipped
7070
if (
7171
["ci", "test", "deps", "chore(deps)", "build(deps)"].includes(prFlavor) ||
72-
(danger.github.pr.body + "").includes("#skip-changelog")
72+
(danger.github.pr.body + "").includes("#skip-changelog") ||
73+
(pr.labels || []).some(label => label.name === 'skip-changelog')
7374
) {
7475
return;
7576
}
@@ -126,7 +127,7 @@ Example:
126127
- ${prTitleFormatted} ([#${danger.github.pr.number}](${danger.github.pr.html_url}))
127128
\`\`\`
128129
129-
If none of the above apply, you can opt out of this check by adding \`#skip-changelog\` to the PR description.`.trim(),
130+
If none of the above apply, you can opt out of this check by adding \`#skip-changelog\` to the PR description or adding a \`skip-changelog\` label.`.trim(),
130131
changelogFile
131132
);
132133
}

0 commit comments

Comments
 (0)