From 0d26bd205be849ec37b8aaebf51484d5be33c86e Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Thu, 4 Apr 2024 10:48:08 -0500 Subject: [PATCH] Tweak label creation logic on backport workflows (#6871) (#6873) * Tweak label creation logic on backport workflows * Tweak label creation logic on backport workflows --------- (cherry picked from commit 801b6ec266e8bd9766f52917dff0d92ccae524de) Signed-off-by: Peter Zhu Signed-off-by: github-actions[bot] Co-authored-by: github-actions[bot] Co-authored-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com> --- .github/workflows/backport.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index 6559b3b15b..92f107839c 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -42,9 +42,9 @@ jobs: - name: Label new backport PR with backport-automerge label run: | - PR_BRANCH=backport/backport-<%= number %>-to-<%= base %> + 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" + 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 env: - GH_TOKEN: ${{ steps.github_app_token.outputs.token }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}