Skip to content

Commit c2a0277

Browse files
authored
docs: document required GitHub App permissions and PAT scopes (#416)
1 parent 5c83c48 commit c2a0277

1 file changed

Lines changed: 21 additions & 3 deletions

File tree

README.md

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,29 @@ This action can be configured to authenticate with GitHub App Installation or Pe
4444
| `GH_APP_PRIVATE_KEY` | True | `""` | GitHub Application Private Key. See [documentation](https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/about-authentication-with-a-github-app) for more details. |
4545
| `GITHUB_APP_ENTERPRISE_ONLY` | False | `false` | Set this input to `true` if your app is created in GHE and communicates with GHE. |
4646

47+
###### Required GitHub App permissions
48+
49+
The GitHub App must be installed on every repository the action will scan
50+
(or installed on the organization with "All repositories" selected), and the
51+
App must be granted these permissions:
52+
53+
- **Repository → Metadata**: Read (default)
54+
- **Repository → Contents**: Read & write — read CODEOWNERS files; create branches and commit the placeholder CODEOWNERS file when one is missing
55+
- **Repository → Pull requests**: Read & write — open PRs that suggest CODEOWNERS changes
56+
- **Organization → Members**: Read — check whether each CODEOWNERS entry is still an organization member
57+
58+
If any of these are missing the action fails with `Error: 403 Resource not accessible by integration` on the first API call that needs the missing permission. Updating an existing App's permissions also requires the installation owner to accept the new permission request before it takes effect.
59+
4760
##### Personal Access Token (PAT)
4861

49-
| field | required | default | description |
50-
| ---------- | -------- | ------- | --------------------------------------------------------------------------------------------------------------------- |
51-
| `GH_TOKEN` | True | `""` | The GitHub Token used to scan the repository. Must have read access to all repository you are interested in scanning. |
62+
| field | required | default | description |
63+
| ---------- | -------- | ------- | ---------------------------------------------------------------------- |
64+
| `GH_TOKEN` | True | `""` | The GitHub Token used to scan repositories. See required scopes below. |
65+
66+
###### Required PAT scopes
67+
68+
- **Classic PAT**: `repo` (read & write to repository contents and pull requests) and `read:org` (organization membership checks)
69+
- **Fine-grained PAT**: for every target repository — **Contents**: Read & write, **Pull requests**: Read & write, **Metadata**: Read; for the organization — **Members**: Read
5270

5371
#### Other Configuration Options
5472

0 commit comments

Comments
 (0)