Skip to content

Commit 87604c1

Browse files
committed
update readme about the permissions of the default token
1 parent ae1b5c6 commit 87604c1

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -80,21 +80,21 @@ All inputs are **optional**. If not set, sensible defaults will be used.
8080
The token input defaults to the repository's `GITHUB_TOKEN`.
8181

8282
> [!IMPORTANT]
83-
> If you want pull requests created by this action to trigger an `on: push` or `on: pull_request` workflow then you cannot use the default `GITHUB_TOKEN`. See the [documentation here](docs/concepts-guidelines.md#triggering-further-workflow-runs) for further details.
83+
> - If you want pull requests created by this action to trigger an `on: push` or `on: pull_request` workflow then you cannot use the default `GITHUB_TOKEN`. See the [documentation here](docs/concepts-guidelines.md#triggering-further-workflow-runs) for further details.
84+
> - If using the repository's `GITHUB_TOKEN` and your repository was created after 2nd February 2023, the [default permission is read-only](https://github.blog/changelog/2023-02-02-github-actions-updating-the-default-github_token-permissions-to-read-only/). Elevate the [permissions](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/controlling-permissions-for-github_token#defining-access-for-the-github_token-permissions) in your workflow.
85+
> ```yml
86+
> permissions:
87+
> contents: write
88+
> pull-requests: write
89+
> ```
8490

8591
Other token options:
8692
- Classic [Personal Access Token (PAT)](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token) with `repo` scope.
8793
- Fine-grained [Personal Access Token (PAT)](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token) with `contents: write` and `pull-requests: write` scopes.
8894
- [GitHub App tokens](docs/concepts-guidelines.md#authenticating-with-github-app-generated-tokens) with `contents: write` and `pull-requests: write` scopes.
8995

9096
> [!TIP]
91-
> - If pull requests could contain changes to Actions workflows you may also need the `workflows` scope.
92-
> - When using the repository's `GITHUB_TOKEN`, it's good practice to employ the [principle of least privilege](https://en.wikipedia.org/wiki/Principle_of_least_privilege) and restrict its [permissions](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/controlling-permissions-for-github_token#defining-access-for-the-github_token-permissions).
93-
> ```yml
94-
> permissions:
95-
> contents: write
96-
> pull-requests: write
97-
> ```
97+
> If pull requests could contain changes to Actions workflows you may also need the `workflows` scope.
9898

9999
#### branch-token
100100

0 commit comments

Comments
 (0)