-
Notifications
You must be signed in to change notification settings - Fork 6
30 lines (29 loc) · 1.05 KB
/
Copy pathgithub-app-token.yaml
File metadata and controls
30 lines (29 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
name: github app token
on:
pull_request:
branches: [main]
push:
branches: [main]
workflow_dispatch:
jobs:
app-token:
if: ${{ github.actor == github.repository_owner }} # because referencing secrets, restrict to owner.
permissions:
contents: read # no pull request permission
runs-on: ubuntu-24.04
timeout-minutes: 3
steps:
- uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1
id: app-token
with:
app-id: ${{ secrets.SYNCED_ACTIONS_BOT_APPID }}
private-key: ${{ secrets.SYNCED_ACTIONS_BOT_PRIVATE_KEY }}
permission-pull-requests: read # grant read access to pull requests
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: List open PRs
run: gh pr list --state open --limit 5
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }} # GitHub App token permission to read pull requests
GH_REPO: ${{ github.repository }}