Skip to content

Commit

Permalink
Enhance changelog workflow to check for missing labels
Browse files Browse the repository at this point in the history
Signed-off-by: Kunal Kotwani <[email protected]>
  • Loading branch information
kotwanikunal committed Apr 12, 2024
1 parent 74232c7 commit d536f82
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
15 changes: 14 additions & 1 deletion .github/workflows/changelog_verifier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
jobs:
# Enforces the update of a changelog file on every pull request
verify-changelog:
if: github.repository == 'opensearch-project/OpenSearch'
# if: github.repository == 'opensearch-project/OpenSearch'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -26,6 +26,19 @@ jobs:
changeLogPath: 'CHANGELOG.md'
continue-on-error: true
- run: |
# The check was possibly skipped leading to success for both the jobs
if [[ ${{ steps.verify-changelog-3x.outcome }} == 'success' && ${{ steps.verify-changelog.outcome }} == 'success' ]]; then
exit 0
fi
if [[ ${{ steps.verify-changelog-3x.outcome }} == 'failure' && ${{ steps.verify-changelog.outcome }} == 'failure' ]]; then
echo "error: Please ensure a changelog entry exists in CHANGELOG.md or CHANGELOG-3.0.md"
exit 1
fi
# Concatenates the labels and checks if the string contains "backport"
has_backport_label=${{ contains(join(github.event.pull_request.labels.*.name, ', '), 'backport')}}
if [[ ${{ steps.verify-changelog.outcome }} == 'success' && $has_backport_label == false ]]; then
echo "error: Please make sure that the PR has a backport label associated with it when making an entry to the CHANGELOG.md file"
exit 1
fi
1 change: 1 addition & 0 deletions CHANGELOG-3.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Tracing for deep search path ([#12103](https://github.com/opensearch-project/OpenSearch/pull/12103))
- Add explicit dependency to validatePom and generatePom tasks ([#12807](https://github.com/opensearch-project/OpenSearch/pull/12807))
- Replace configureEach with all for publication iteration ([#12876](https://github.com/opensearch-project/OpenSearch/pull/12876))
- Should not complain for this change

### Dependencies
- Bump `log4j-core` from 2.18.0 to 2.19.0
Expand Down

0 comments on commit d536f82

Please sign in to comment.