Skip to content

Commit 30b7b04

Browse files
authored
Merge pull request #6347 from tvdeyen/backport-solidus-app
feat(CI): Use Solidus Bot App to create backport PRs
2 parents 2d1fcff + 7eaa19a commit 30b7b04

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

.github/workflows/backport.yml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ on:
33
pull_request_target:
44
types: ["labeled", "closed"]
55

6+
permissions:
7+
pull-requests: write
8+
69
jobs:
710
backport:
811
runs-on: ubuntu-latest
@@ -17,10 +20,16 @@ jobs:
1720
(github.event.action == 'closed')
1821
)
1922
steps:
23+
- name: Generate token
24+
id: generate_token
25+
uses: actions/create-github-app-token@v2
26+
with:
27+
app-id: ${{ vars.SOLIDUS_BOT_APP_ID }}
28+
private-key: ${{ secrets.SOLIDUS_BOT_APP_PRIVATE_KEY }}
2029
- name: Backport Action
2130
uses: sqren/backport-github-action@v9.5.1
2231
with:
23-
github_token: ${{ secrets.GITHUB_TOKEN }}
32+
github_token: ${{ steps.generate_token.outputs.token }}
2433
auto_backport_label_prefix: backport-
2534
add_original_reviewers: true
2635
- name: Info log
@@ -29,13 +38,3 @@ jobs:
2938
- name: Debug log
3039
if: ${{ failure() }}
3140
run: cat ~/.backport/backport.debug.log
32-
- name: Trigger Test Run
33-
uses: actions/github-script@v8
34-
with:
35-
script: |
36-
github.rest.actions.createWorkflowDispatch({
37-
owner: context.repo.owner,
38-
repo: context.repo.repo,
39-
workflow_id: 'test.yml',
40-
ref: context.ref,
41-
})

0 commit comments

Comments
 (0)