Skip to content

Commit

Permalink
Tweak label creation logic on backport workflows
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Zhu <[email protected]>
  • Loading branch information
peterzhuamazon committed Apr 3, 2024
1 parent 4106b93 commit baff2e2
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/backport.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit baff2e2

Please sign in to comment.