Skip to content

Commit 8e295bb

Browse files
authored
Merge pull request #118 from santunioni/patch-1
Fix: Information related to tokens in README
2 parents b860159 + 3c4e552 commit 8e295bb

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

README.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,22 @@ A GitHub action to create a repository dispatch event.
1818
1919
| Name | Description | Default |
2020
| --- | --- | --- |
21-
| `token` | (**required**) A `repo` scoped GitHub [Personal Access Token](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token). See [token](#token) for further details. | |
21+
| `token` | (**required**) A GitHub access token with `actions: write` permission to the repository being dispatched. | |
2222
| `repository` | The full name of the repository to send the dispatch. | `github.repository` (current repository) |
2323
| `event-type` | (**required**) A custom webhook event name. | |
2424
| `client-payload` | JSON payload with extra information about the webhook event that your action or workflow may use. | `{}` |
2525

2626
#### `token`
2727

28-
This action creates [`repository_dispatch`](https://developer.github.com/v3/repos/#create-a-repository-dispatch-event) events.
29-
The default `GITHUB_TOKEN` does not have scopes to do this so a `repo` scoped [PAT](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token) created on a user with `write` access to the target repository is required.
28+
This action creates [`repository_dispatch`](https://developer.github.com/v3/repos/#create-a-repository-dispatch-event) events. The default `GITHUB_TOKEN`
29+
token can only be used if you are dispatching the same repo. In this case you must assign the permission `action: write` to the token, see [permissions api](https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs). Example:
30+
```yaml
31+
permissions:
32+
actions: write
33+
```
34+
35+
The solution to trigger other repositories is to manually create a [PAT](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token) and store it as a secret e.g. `${{ secrets.PERSONAL_TOKEN }}`.
36+
3037
If you will be dispatching to a public repository then you can use the more limited `public_repo` scope.
3138

3239
## Example

0 commit comments

Comments
 (0)