Skip to content

Commit 71a38a3

Browse files
authored
Document and use correct permissions in the GitHub workflows (#258)
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 #194 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent f141760 commit 71a38a3

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

.github/workflows/links.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ on:
99
jobs:
1010
linkChecker:
1111
runs-on: ubuntu-latest
12+
permissions:
13+
issues: write # required for peter-evans/create-issue-from-file
1214
steps:
1315
- uses: actions/checkout@v4
1416

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
Quickly check links in Markdown, HTML, and text files using [lychee].
77

88
When used in conjunction with [Create Issue From File], issues will be
9-
opened when the action finds link problems.
9+
opened when the action finds link problems (make sure to specify the `issues: write` permission in the [workflow](https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#permissions) or the [job](https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#jobsjob_idpermissions)).
1010

1111
## Usage
1212

@@ -27,6 +27,8 @@ on:
2727
jobs:
2828
linkChecker:
2929
runs-on: ubuntu-latest
30+
permissions:
31+
issues: write # required for peter-evans/create-issue-from-file
3032
steps:
3133
- uses: actions/checkout@v4
3234

0 commit comments

Comments
 (0)