Skip to content

Commit 4106b93

Browse files
Tweak label creation logic on backport workflows
Signed-off-by: Peter Zhu <[email protected]>
1 parent afa4d27 commit 4106b93

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Diff for: .github/workflows/backport.yml

+5-3
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,11 @@ jobs:
4242

4343
- name: Label new backport PR with backport-automerge label
4444
run: |
45-
PR_BRANCH=backport/backport-<%= number %>-to-<%= base %>
45+
PR_BRANCH=`echo ${{ github.event.label.name }}`
46+
PR_BRANCH=`echo $PR_BRANCH | cut -d ' ' -f2`
47+
PR_BRANCH=backport/backport-${{ github.event.pull_request.number }}-to-$PR_BRANCH
4648
PR_NUMBER=`gh pr list -R opensearch-project/documentation-website --json "number,headRefName" --state open | jq -r ".[] | select(.headRefName == \"$PR_BRANCH\") | .number"`
47-
echo "Update Backport PR #$PR_NUMBER on branch $PR_BRANCH with backport-automerge label"
49+
echo "Update Backport PR '#$PR_NUMBER' on branch '$PR_BRANCH' with 'backport-automerge' label"
4850
gh issue edit -R opensearch-project/documentation-website $PR_NUMBER --add-label backport-automerge
4951
env:
50-
GH_TOKEN: ${{ steps.github_app_token.outputs.token }}
52+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)