From 350c2756738c5da1ab95276aa79061add5a8e603 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 | 19 ++++++++++++++++++- CHANGELOG.md | 1 + 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/changelog_verifier.yml b/.github/workflows/changelog_verifier.yml index 04e2ed5006269..50425a51c0b90 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,22 @@ 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 + + has_backport_label=false + labels=${{ join(github.event.pull_request.labels.*.name, ', ) }} + echo "Labels: $labels" + for label in $labels; do + echo "Label: $label" + if [[ $label =~ "backport" ]]; then + has_backport_label=true + break + fi + done + + 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 diff --git a/CHANGELOG.md b/CHANGELOG.md index 77f3e3a5dcc04..7bcb7e5f2107d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - [Remote Store] Make translog transfer timeout configurable ([#12704](https://github.com/opensearch-project/OpenSearch/pull/12704)) - Reject Resize index requests (i.e, split, shrink and clone), While DocRep to SegRep migration is in progress.([#12686](https://github.com/opensearch-project/OpenSearch/pull/12686)) - Add support for more than one protocol for transport ([#12967](https://github.com/opensearch-project/OpenSearch/pull/12967)) +- Test ### Dependencies - Bump `org.apache.commons:commons-configuration2` from 2.10.0 to 2.10.1 ([#12896](https://github.com/opensearch-project/OpenSearch/pull/12896))