Skip to content

Commit 0db985f

Browse files
committed
Add warning about required actions permissions on README.md
1 parent 50750fa commit 0db985f

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

README.md

+22-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,27 @@ This action for [Changesets](https://github.com/atlassian/changesets) creates a
1919
- published - A boolean value to indicate whether a publishing has happened or not
2020
- publishedPackages - A JSON array to present the published packages. The format is `[{"name": "@xx/xx", "version": "1.2.0"}, {"name": "@xx/xy", "version": "0.8.9"}]`
2121

22-
### Example workflow:
22+
### Example workflows
23+
24+
> [!WARNING]
25+
>
26+
> Before run one of the following workflows be sure that the `GITHUB_TOKEN` has the permission to access the repository contents and create a PR
27+
>
28+
> - Go into [repository Action settings](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#setting-the-permissions-of-the-github_token-for-your-repository)
29+
>
30+
> - Under "Workflow permissions" section, enable "Allow GitHub Actions to create and approve pull requests"
31+
>
32+
> - Now you should grant write permission, you can do this by
33+
>
34+
> 1. [Using `permissions` key in the workflow file](https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#permissions)
35+
>
36+
> ```yml
37+
> permissions:
38+
> contents: write
39+
> pull-requests: write
40+
> ```
41+
>
42+
> 2. selecting "Read and write permissions" in the same section
2343
2444
#### Without Publishing
2545

@@ -105,7 +125,7 @@ jobs:
105125

106126
By default the GitHub Action creates a `.npmrc` file with the following content:
107127

108-
```
128+
```text
109129
//registry.npmjs.org/:_authToken=${process.env.NPM_TOKEN}
110130
```
111131

0 commit comments

Comments
 (0)