lycheeverse / lychee-action

Github action to check for broken links in Markdown, HTML, and text files using lychee, a fast link checker written in Rust.
https://lychee.cli.rs
Apache License 2.0
323 stars 48 forks source link

Document and use correct permissions in the GitHub workflows #258

Closed dscho closed 3 weeks ago

dscho commented 3 weeks ago

When the intention is to potentially create a new GitHub issue, the workflows in question need to set the permissions correctly. Otherwise the workflow runs may fail with:

Error: Resource not accessible by integration

which is an admittedly very cryptic way to say that the GITHUB_TOKEN used in the GitHub workflow run lacks a particular scope to perform the desired operation.

Note: The GITHUB_TOKEN used to have read/write permissions for all scopes by default, but that changed to read-only as per https://github.blog/changelog/2023-02-02-github-actions-updating-the-default-github_token-permissions-to-read-only; That is the reason why this here change is necessary.

This fixes https://github.com/lycheeverse/lychee-action/issues/194

mre commented 3 weeks ago

Perfect. Thanks!