Skip to content

Commit

Permalink
use GitHub App token to avoid restriction of default GITHUB_TOKEN
Browse files Browse the repository at this point in the history
  • Loading branch information
jiftechnify committed Nov 20, 2023
1 parent 6d3032c commit cdf70a6
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions .github/workflows/sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,25 @@ on:
schedule:
- cron: "0 0 * * *"

permissions:
pull-requests: write
contents: write

jobs:
create_token:
runs-on: ubuntu-latest
timeout-minutes: 3
outputs:
token: ${{ steps.create.outputs.token }}
steps:
- uses: tibdex/github-app-token@v2
id: create
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.PRIVATE_KEY }}

sync:
runs-on: ubuntu-latest
timeout-minutes: 10
needs: create_token
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ needs.create_token.outputs.token }}
steps:
- uses: actions/checkout@v4
with:
Expand Down

0 comments on commit cdf70a6

Please sign in to comment.