From 4ba79ca852e928a6fb581c3264e3cc516cbee8e0 Mon Sep 17 00:00:00 2001 From: Kunal Kotwani Date: Wed, 10 Apr 2024 16:34:40 -0700 Subject: [PATCH] Enhance changelog workflow to check for missing labels Signed-off-by: Kunal Kotwani --- .github/workflows/changelog_verifier.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/changelog_verifier.yml b/.github/workflows/changelog_verifier.yml index 04e2ed5006269..8b53faf82526d 100644 --- a/.github/workflows/changelog_verifier.yml +++ b/.github/workflows/changelog_verifier.yml @@ -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 @@ -27,5 +27,12 @@ jobs: continue-on-error: true - run: | 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 + + labels=${{ github.event.pull_request.labels.*.name }} + if [[ ${{ steps.verify-changelog.outcome }} == 'success' && ! $labels =~ "backport" ]]; 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