From 6b481a7dc8639a070f8aa42773aa9c5a497f79c7 Mon Sep 17 00:00:00 2001 From: Deepthi Sigireddi Date: Thu, 14 Dec 2023 15:33:12 -0800 Subject: [PATCH] Enhance PR template + CI workflow for backport labels. (#14779) Signed-off-by: deepthi --- .github/pull_request_template.md | 5 +++-- .github/workflows/check_label.yml | 6 ++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 595995681f9..7306523f000 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -18,9 +18,10 @@ ## Checklist -- [ ] "Backport to:" labels have been added if this change should be back-ported +- [ ] "Backport to:" labels have been added if this change should be back-ported to release branches +- [ ] If this change is to be back-ported to previous releases, a justification is included in the PR description - [ ] Tests were added or are not required -- [ ] Did the new or modified tests pass consistently locally and on the CI +- [ ] Did the new or modified tests pass consistently locally and on CI? - [ ] Documentation was added or is not required ## Deployment Notes diff --git a/.github/workflows/check_label.yml b/.github/workflows/check_label.yml index c3c89273df8..7d53d55055b 100644 --- a/.github/workflows/check_label.yml +++ b/.github/workflows/check_label.yml @@ -68,6 +68,12 @@ jobs: echo "Expecting PR to not have the NeedsIssue label; please create a linked issue and remove the label." exit 1 fi + if cat ${LABELS_JSON} | jq -r '.[].name ' | grep -q 'NeedsBackportReason' ; then + if cat ${LABELS_JSON} | jq -r '.[].name ' | grep -q 'Backport to:'; then + echo "Expecting PR to not have the NeedsBackportReason label; please add your justification to the PR description and remove the label." + exit 1 + fi + fi - name: Do Not Merge label