Skip to content

Commit 65cf1e4

Browse files
jed326Jay Deng
authored and
Jay Deng
committed
Improve breaking change logic for changelog verifier
Signed-off-by: Jay Deng <jayd0104@gmail.com>
1 parent 2311195 commit 65cf1e4

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

.github/workflows/changelog_verifier.yml

+14-3
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,29 @@ jobs:
2727
continue-on-error: true
2828
- run: |
2929
# The check was possibly skipped leading to success for both the jobs
30+
has_backport_label=${{ contains(join(github.event.pull_request.labels.*.name, ', '), 'backport')}}
31+
has_breaking_label=${{ contains(join(github.event.pull_request.labels.*.name, ', '), '>breaking')}}
32+
if [[ $has_breaking_label == true && $has_backport_label == true ]]; then
33+
echo "error: Please make sure that the PR does not have a backport label associated with it when making breaking changes"
34+
exit 1
35+
fi
36+
3037
if [[ ${{ steps.verify-changelog-3x.outcome }} == 'success' && ${{ steps.verify-changelog.outcome }} == 'success' ]]; then
3138
exit 0
3239
fi
33-
40+
3441
if [[ ${{ steps.verify-changelog-3x.outcome }} == 'failure' && ${{ steps.verify-changelog.outcome }} == 'failure' ]]; then
3542
echo "error: Please ensure a changelog entry exists in CHANGELOG.md or CHANGELOG-3.0.md"
3643
exit 1
3744
fi
38-
45+
3946
# Concatenates the labels and checks if the string contains "backport"
40-
has_backport_label=${{ contains(join(github.event.pull_request.labels.*.name, ', '), 'backport')}}
4147
if [[ ${{ steps.verify-changelog.outcome }} == 'success' && $has_backport_label == false ]]; then
4248
echo "error: Please make sure that the PR has a backport label associated with it when making an entry to the CHANGELOG.md file"
4349
exit 1
4450
fi
51+
52+
if [[ ${{ steps.verify-changelog-3x.outcome }} == 'success' && $has_backport_label == true ]]; then
53+
echo "error: Please make sure that the PR does not have a backport label associated with it when making an entry to the CHANGELOG-3.0.md file"
54+
exit 1
55+
fi

0 commit comments

Comments
 (0)