Skip to content

Commit 4803812

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

1 file changed

Lines changed: 21 additions & 2 deletions

File tree

README.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,26 @@ 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. selecting "Read and write permissions" in the same section
35+
> 2. [Using `permissions` key in the workflow file](https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#permissions)
36+
>
37+
> ```yml
38+
> permissions:
39+
> contents: write
40+
> pull-requests: write
41+
> ```
2342
2443
#### Without Publishing
2544

@@ -105,7 +124,7 @@ jobs:
105124

106125
By default the GitHub Action creates a `.npmrc` file with the following content:
107126

108-
```
127+
```text
109128
//registry.npmjs.org/:_authToken=${process.env.NPM_TOKEN}
110129
```
111130

0 commit comments

Comments
 (0)