Skip to content

Commit 6ef1a90

Browse files
authored
Use GitHub App token in backport workflow to trigger CI (#82)
1 parent ca177aa commit 6ef1a90

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

.github/workflows/backport.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,28 @@ jobs:
1313
runs-on: ubuntu-latest
1414

1515
# Only run when pull request is merged
16-
# or when a comment starting with `/cherry-pick` is created by someone other than the
17-
# https://github.com/backport-action bot user (user id: 97796249). Note that if you use your
18-
# own PAT as `github_token`, that you should replace this id with yours.
16+
# or when a comment starting with `/cherry-pick` is created by someone other than the CI bot
1917
if: >
2018
(
2119
github.event_name == 'pull_request_target' &&
2220
github.event.pull_request.merged
2321
) || (
2422
github.event_name == 'issue_comment' &&
2523
github.event.issue.pull_request &&
26-
github.event.comment.user.id != 97796249 &&
24+
github.event.comment.user.id != 278318962 &&
2725
startsWith(github.event.comment.body, '/cherry-pick')
2826
)
2927
steps:
28+
- uses: actions/create-github-app-token@v1
29+
id: app-token
30+
with:
31+
app-id: ${{ vars.CI_APP_ID }}
32+
private-key: ${{ secrets.CI_APP_KEY }}
3033
- uses: actions/checkout@v4
3134
- name: Create backport pull requests
3235
uses: korthout/backport-action@v4
3336
with:
37+
github_token: ${{ steps.app-token.outputs.token }}
3438
add_author_as_assignee: true
3539
auto_merge_method: "squash"
3640
pull_title: "[${target_branch}] ${pull_title}"

0 commit comments

Comments
 (0)