From baff2e27c2e83a1f9f05b9ff13c97eef3be6d551 Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Wed, 3 Apr 2024 17:34:27 -0400 Subject: [PATCH] Tweak label creation logic on backport workflows Signed-off-by: Peter Zhu --- .github/workflows/backport.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index c792ee9434..92f107839c 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -42,9 +42,7 @@ jobs: - name: Label new backport PR with backport-automerge label run: | - PR_BRANCH=`echo ${{ github.event.label.name }}` - PR_BRANCH=`echo $PR_BRANCH | cut -d ' ' -f2` - PR_BRANCH=backport/backport-${{ github.event.pull_request.number }}-to-$PR_BRANCH + PR_BRANCH=backport/backport-${{ github.event.pull_request.number }}-to-`echo ${{ github.event.label.name }} | cut -d ' ' -f2` PR_NUMBER=`gh pr list -R opensearch-project/documentation-website --json "number,headRefName" --state open | jq -r ".[] | select(.headRefName == \"$PR_BRANCH\") | .number"` echo "Update Backport PR '#$PR_NUMBER' on branch '$PR_BRANCH' with 'backport-automerge' label" gh issue edit -R opensearch-project/documentation-website $PR_NUMBER --add-label backport-automerge