Skip to content

Commit 1ccb4df

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 1ccb4df

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

.github/workflows/changelog_verifier.yml

+13-2
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,26 @@ jobs:
3030
if [[ ${{ steps.verify-changelog-3x.outcome }} == 'success' && ${{ steps.verify-changelog.outcome }} == 'success' ]]; then
3131
exit 0
3232
fi
33-
33+
3434
if [[ ${{ steps.verify-changelog-3x.outcome }} == 'failure' && ${{ steps.verify-changelog.outcome }} == 'failure' ]]; then
3535
echo "error: Please ensure a changelog entry exists in CHANGELOG.md or CHANGELOG-3.0.md"
3636
exit 1
3737
fi
38-
38+
3939
# Concatenates the labels and checks if the string contains "backport"
4040
has_backport_label=${{ contains(join(github.event.pull_request.labels.*.name, ', '), 'backport')}}
4141
if [[ ${{ steps.verify-changelog.outcome }} == 'success' && $has_backport_label == false ]]; then
4242
echo "error: Please make sure that the PR has a backport label associated with it when making an entry to the CHANGELOG.md file"
4343
exit 1
4444
fi
45+
46+
if [[ ${{ steps.verify-changelog-3x.outcome }} == 'success' && $has_backport_label == true ]]; then
47+
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"
48+
exit 1
49+
fi
50+
51+
has_breaking_label=${{ contains(join(github.event.pull_request.labels.*.name, ', '), '>breaking')}}
52+
if [[ $has_breaking_label == true && $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 breaking changes"
54+
exit 1
55+
fi

0 commit comments

Comments
 (0)