Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add permissions required to README.md #64

Merged
merged 5 commits into from
Oct 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,28 @@ In order to use this action, you will need to generate a JSON file using the fol
]
```

## Permissions

It is possible you have a `GITHUB_TOKEN` with restricted access by default, in which case you might get the following error:

```
Error: GitHubApiUnauthorizedError: Unable to create a check, please make sure that the provided 'repo-token' has write permissions to 'your/repo' - cause: HttpError: Resource not accessible by integration
```

You need to provide the `checks` write permission:

```yaml
permissions:
checks: write
```

You can use `permissions` either as a top-level key, to apply to all jobs in the workflow, or within specific jobs.
When you add the permissions key within a specific job, all actions and run commands within that job that use the `GITHUB_TOKEN` gain the access rights you specify.

**IMPORTANT**: Setting a `permissions` field will disable all omitted permissions, like the `contents: read`, which is needed to clone and read your repository.

You can learn more about `GITHUB_TOKEN` permissions at: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token

## Inputs

### `repo-token`
Expand Down