Skip to content

Commit f011713

Browse files
loewenheimvaind
andauthored
feat(danger): Allow skipping changelog with label (#94)
* 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`. * Fix pr reference * changelog * Update CHANGELOG.md --------- Co-authored-by: Ivan Dlugos <[email protected]>
1 parent 831aefe commit f011713

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## 2.13.0
4+
5+
### Features
6+
7+
- Danger - Changelog checks can now additionally be skipped with a `skip-changelog` label ([#94](https://github.com/getsentry/github-workflows/pull/94))
8+
39
## 2.12.0
410

511
### Features

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+
(danger.github.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)