Skip to content

Commit f37ad8a

Browse files
authored
Enhance changelog workflow to check for missing labels (opensearch-project#13167)
Signed-off-by: Kunal Kotwani <kkotwani@amazon.com>
1 parent 6afbcd4 commit f37ad8a

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

.github/workflows/changelog_verifier.yml

+13
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,19 @@ jobs:
2626
changeLogPath: 'CHANGELOG.md'
2727
continue-on-error: true
2828
- run: |
29+
# The check was possibly skipped leading to success for both the jobs
30+
if [[ ${{ steps.verify-changelog-3x.outcome }} == 'success' && ${{ steps.verify-changelog.outcome }} == 'success' ]]; then
31+
exit 0
32+
fi
33+
2934
if [[ ${{ steps.verify-changelog-3x.outcome }} == 'failure' && ${{ steps.verify-changelog.outcome }} == 'failure' ]]; then
35+
echo "error: Please ensure a changelog entry exists in CHANGELOG.md or CHANGELOG-3.0.md"
36+
exit 1
37+
fi
38+
39+
# Concatenates the labels and checks if the string contains "backport"
40+
has_backport_label=${{ contains(join(github.event.pull_request.labels.*.name, ', '), 'backport')}}
41+
if [[ ${{ steps.verify-changelog.outcome }} == 'success' && $has_backport_label == false ]]; then
42+
echo "error: Please make sure that the PR has a backport label associated with it when making an entry to the CHANGELOG.md file"
3043
exit 1
3144
fi

0 commit comments

Comments
 (0)