Skip to content

Commit 7a0b15a

Browse files
docs: clarify GITHUB_TOKEN permissions needed for private repos (#1574)
* docs: clarify `GITHUB_TOKEN` permissions needed for private repos (fixes #1248) * docs: simplify private-repo perms example (remove steps; job-level permissions only) --------- Signed-off-by: Pankaj Taneja <[email protected]> Co-authored-by: Stephen Augustus <[email protected]>
1 parent 9db932c commit 7a0b15a

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,27 @@ GitHub's new [Repository Rules](https://docs.github.com/repositories/configuring
8787
We recommend new repositories use Repository Rules so they can be read with the default GitHub token.
8888
Repositories that already use classic Branch Protection and wish to see their results without an admin token should consider migrating to Repository Rules.
8989

90+
### Additional permissions for private repositories
91+
92+
When running Scorecard Action on **private repositories** with the default `GITHUB_TOKEN`, add these **job-level permissions** so Scorecard can query commits and detect configured SAST tools. Without them you may see errors like:
93+
94+
> `Resource not accessible by integration` (e.g., during GraphQL ListCommits)
95+
96+
```yaml
97+
jobs:
98+
analysis:
99+
runs-on: ubuntu-latest
100+
permissions:
101+
# Required when publishing results (badge / API / code scanning)
102+
security-events: write
103+
id-token: write
104+
# Recommended reads for private repos to avoid GraphQL/SAST gaps
105+
contents: read
106+
issues: read
107+
pull-requests: read
108+
checks: read
109+
```
110+
90111
## View Results
91112
92113
The workflow is preconfigured to run on every repository contribution. After making a code change, you can view the results for the change either through the Scorecard Badge, Code Scanning Alerts or GitHub Workflow Runs.

0 commit comments

Comments
 (0)