Skip to content

Commit c90b2e6

Browse files
committed
Use app tokens in other github actions
1 parent 128f93d commit c90b2e6

2 files changed

Lines changed: 19 additions & 2 deletions

File tree

.github/workflows/deploy-instance-pr-actions.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,19 @@ jobs:
99

1010
env:
1111
INSTANCE_REPO_GITHUB: scverse/cookiecutter-scverse-instance
12-
GH_TOKEN: ${{ secrets.BOT_GH_TOKEN }} # for gh cli
1312

1413
steps:
14+
- name: Generate tokens
15+
id: app-token
16+
uses: actions/create-github-app-token@v2
17+
with:
18+
app-id: ${{ vars.PR_CREATOR_APP_ID }}
19+
private-key: ${{ secrets.PR_CREATOR_PRIVATE_KEY }}
20+
repositories: cookiecutter-scverse-instance
21+
22+
- name: Authenticate gh CLI with app token
23+
run: echo "${{ steps.app-token.outputs.token }}" | gh auth login --with-token
24+
1525
- name: Define sister PR branch name
1626
run: |
1727
echo "SISTER_PR_BRANCH=pr-${{ github.event.pull_request.number }}" >> $GITHUB_ENV

.github/workflows/propagate-pre-commit.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,16 @@ jobs:
1010
runs-on: ubuntu-latest
1111
if: ${{ github.actor == 'pre-commit-ci[bot]' }}
1212
steps:
13+
- name: Generate tokens
14+
id: app-token
15+
uses: actions/create-github-app-token@v2
16+
with:
17+
app-id: ${{ vars.PR_CREATOR_APP_ID }}
18+
private-key: ${{ secrets.PR_CREATOR_PRIVATE_KEY }}
19+
1320
- uses: actions/checkout@v6
1421
with:
15-
token: ${{ secrets.BOT_GH_TOKEN }}
22+
token: ${{ steps.app-token.outputs.token }}
1623
- run: pipx install pre-commit
1724
- run: cd '{{cookiecutter.project_name}}' && pre-commit autoupdate
1825
- uses: stefanzweifel/git-auto-commit-action@v7

0 commit comments

Comments
 (0)