Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions .github/workflows/backport.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
backport:
permissions:
contents: write # required for pushing branches
pull-requests: write # required for creating pull requests
pull-requests: write # required for creating and editing pull requests
runs-on: ubuntu-latest
steps:
- run: |
Expand All @@ -37,6 +37,7 @@ jobs:
private-key: ${{ secrets.OTELBOT_PRIVATE_KEY }}

- name: Create pull request
id: create_pr
env:
NUMBER: ${{ github.event.inputs.number }}
# not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows
Expand All @@ -49,7 +50,15 @@ jobs:

git cherry-pick $commit
git push origin HEAD:$branch
gh pr create --title "[$GITHUB_REF_NAME] $title" \
--body "Clean cherry-pick of #$NUMBER to the \`$GITHUB_REF_NAME\` branch." \
--head $branch \
--base $GITHUB_REF_NAME
pr_url=$(gh pr create --title "[$GITHUB_REF_NAME] $title" \
--body "Clean cherry-pick of #$NUMBER to the \`$GITHUB_REF_NAME\` branch." \
--head $branch \
--base $GITHUB_REF_NAME)
echo "pr_url=$pr_url" >> $GITHUB_OUTPUT

- name: Add backport label to PR
if: steps.create_pr.outputs.pr_url != ''
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr edit ${{ steps.create_pr.outputs.pr_url }} --add-label "backport"
Loading