Skip to content

Commit e6fefb0

Browse files
authored
docs: improve docs around "Resource not accessible by integration" (#257)
1 parent db437f0 commit e6fefb0

1 file changed

Lines changed: 38 additions & 1 deletion

File tree

README.md

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This GitHub Action allows you to create [Check Runs](https://developer.github.co
66

77
The following shows how to publish a Check Run which will have the same status as your job and contains the output of another action. This will be shown predominantly in a Pull Request or on the workflow run.
88

9-
```
9+
```yaml
1010
name: "build-test"
1111
on: [push]
1212

@@ -29,6 +29,43 @@ jobs:
2929
3030
See the [examples workflow](.github/workflows/examples.yml) for more details and examples (and see the [associated runs](https://github.com/LouisBrunner/checks-action/actions?query=workflow%3Aexamples) to see how it will look like).
3131
32+
### Permissions
33+
34+
When the action is run as part of a Pull Request, your workflow might fail with the following error: `Error: Resource not accessible by integration`.
35+
36+
You can solve this in multiple ways:
37+
38+
* Increase the permissions given to `GITHUB_TOKEN` (see https://github.com/actions/first-interaction/issues/10#issuecomment-1232740076), please note that you should understand the security implications of this change
39+
* Use a Github App token instead of a `GITHUB_TOKEN` (see https://github.com/LouisBrunner/checks-action/issues/26#issuecomment-1232948025)
40+
41+
Most of the time, it means setting up your workflow this way:
42+
43+
```yaml
44+
name: "build-test"
45+
on: [push]
46+
47+
jobs:
48+
test_something:
49+
runs-on: ubuntu-latest
50+
permissions:
51+
checks: write
52+
contents: read
53+
steps:
54+
- uses: actions/checkout@v1
55+
- uses: actions/create-outputs@v0.0.0-fake
56+
id: test
57+
- uses: LouisBrunner/checks-action@v1.6.1
58+
if: always()
59+
with:
60+
token: ${{ secrets.GITHUB_TOKEN }}
61+
name: Test XYZ
62+
conclusion: ${{ job.status }}
63+
output: |
64+
{"summary":"${{ steps.test.outputs.summary }}"}
65+
```
66+
67+
Notice the extra `permissions` section.
68+
3269
## Inputs
3370

3471
### `repo`

0 commit comments

Comments
 (0)