Skip to content

Commit 3e55702

Browse files
authored
Modify README workflow so that the PR is created by a bot (#5251)
1 parent 161f4ee commit 3e55702

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

.github/workflows/readme.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ jobs:
2424

2525
runs-on: ubuntu-latest
2626
steps:
27+
- uses: actions/create-github-app-token@v1
28+
id: generate-token
29+
with:
30+
app-id: ${{ secrets.README_BOT_APP_ID }}
31+
private-key: ${{ secrets.README_BOT_PRIVATE_KEY }}
32+
2733
- uses: actions/checkout@v4
2834

2935
- name: Read repo config
@@ -53,16 +59,17 @@ jobs:
5359
uses: peter-evans/create-pull-request@v7
5460
with:
5561
commit-message: Regenerated READMEs
56-
committer: GitHub Actions <action@github.com>
62+
author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
5763
branch: readme-generation
5864
delete-branch: true
5965
title: '[Automated Workflow] Add/Modify READMEs'
6066
labels: enhancement
61-
token: ${{ secrets.PAT }}
67+
token: ${{ steps.generate-token.outputs.token }}
6268

6369
- name: Enable Pull Request Automerge
6470
if: steps.cpr.outputs.pull-request-operation == 'created'
6571
uses: peter-evans/enable-pull-request-automerge@v3
6672
with:
6773
pull-request-number: ${{ steps.cpr.outputs.pull-request-number }}
6874
merge-method: squash
75+
token: ${{ steps.generate-token.outputs.token }}

0 commit comments

Comments
 (0)