Skip to content

Commit

Permalink
ci: use bot token for backport
Browse files Browse the repository at this point in the history
This allows GitHub Action workflows to be triggered for the PR created
by the bot.

As things are now triggered by the bot, elevated permissions of the
workflow itself are no longer required.

Signed-off-by: Hidde Beydals <[email protected]>
  • Loading branch information
hiddeco committed Jul 4, 2023
1 parent 6f88d59 commit 80eeff2
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/backport.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ permissions:
jobs:
pull-request:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
if: github.event.pull_request.state == 'closed' && github.event.pull_request.merged && (github.event_name != 'labeled' || startsWith('backport:', github.event.label.name))
steps:
- name: Checkout
Expand All @@ -23,6 +20,8 @@ jobs:
uses: korthout/backport-action@bf5fdd624b35f95d5b85991a728bd5744e8c6cf2 # v1.3.1
# xref: https://github.com/korthout/backport-action#inputs
with:
# Use token to allow workflows to be triggered for the created PR
github_token: ${{ secrets.BOT_GITHUB_TOKEN }}
# Match labels with a pattern `backport:<target-branch>`
label_pattern: '^backport:([^ ]+)$'
# A bit shorter pull-request title than the default
Expand Down

0 comments on commit 80eeff2

Please sign in to comment.