Skip to content

Commit b64a0d9

Browse files
authored
chore: replace all github.token/GITHUB_TOKEN with GitHub App token (#475)
1 parent 82eddf3 commit b64a0d9

2 files changed

Lines changed: 17 additions & 3 deletions

File tree

.github/workflows/dependabot-auto-merge.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,18 @@ jobs:
3333
if: github.actor == 'dependabot[bot]'
3434

3535
steps:
36+
- name: Generate GitHub App Token
37+
id: app-token
38+
uses: actions/create-github-app-token@v1
39+
with:
40+
app-id: ${{ vars.APP_ID }}
41+
private-key: ${{ secrets.APP_PRIVATE_KEY }}
42+
3643
- name: Fetch Dependabot metadata
3744
id: metadata
3845
uses: dependabot/fetch-metadata@v2
3946
with:
40-
github-token: ${{ secrets.GITHUB_TOKEN }}
47+
github-token: ${{ steps.app-token.outputs.token }}
4148

4249
# patch and minor bumps: enable auto-merge.
4350
# GitHub holds the merge until all required status checks pass.
@@ -48,7 +55,7 @@ jobs:
4855
steps.metadata.outputs.update-type == 'version-update:semver-minor'
4956
env:
5057
PR_URL: ${{ github.event.pull_request.html_url }}
51-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58+
GH_TOKEN: ${{ steps.app-token.outputs.token }}
5259
run: |
5360
gh pr merge --auto --squash "$PR_URL"
5461
echo "✓ Auto-merge enabled: ${{ steps.metadata.outputs.dependency-names }} \

.github/workflows/release-prepare.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,16 @@ jobs:
115115
exit 1
116116
fi
117117
118+
- name: Generate GitHub App Token
119+
id: app-token
120+
uses: actions/create-github-app-token@v1
121+
with:
122+
app-id: ${{ vars.APP_ID }}
123+
private-key: ${{ secrets.APP_PRIVATE_KEY }}
124+
118125
- name: Create Pull Request
119126
env:
120-
GH_TOKEN: ${{ github.token }}
127+
GH_TOKEN: ${{ steps.app-token.outputs.token }}
121128
NEW_VERSION: ${{ steps.bump.outputs.version }}
122129
GITHUB_REF: ${{ github.ref }}
123130
GITHUB_ACTOR: ${{ github.actor }}

0 commit comments

Comments
 (0)