Skip to content

Commit 3ab740d

Browse files
authored
Merge pull request #63 from peter-evans/default-reaction-token
Default reaction-token to github.token
2 parents 6181a5a + 9d99b44 commit 3ab740d

File tree

5 files changed

+49
-1068
lines changed

5 files changed

+49
-1068
lines changed

.github/workflows/slash-command-dispatch.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ jobs:
1818
uses: ./
1919
with:
2020
token: ${{ secrets.REPO_ACCESS_TOKEN }}
21-
reaction-token: ${{ secrets.GITHUB_TOKEN }}
2221
commands: hello-world-local, ping-local
2322
permission: none
2423
issue-type: issue
@@ -28,7 +27,6 @@ jobs:
2827
uses: ./
2928
with:
3029
token: ${{ secrets.REPO_ACCESS_TOKEN }}
31-
reaction-token: ${{ secrets.GITHUB_TOKEN }}
3230
config: >
3331
[
3432
{
@@ -95,6 +93,5 @@ jobs:
9593
uses: ./
9694
with:
9795
token: ${{ secrets.REPO_ACCESS_TOKEN }}
98-
reaction-token: ${{ secrets.GITHUB_TOKEN }}
9996
reactions: false
10097
config-from-file: .github/slash-command-dispatch.json

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ This action also features [advanced configuration](docs/advanced-configuration.m
6464
| Input | Description | Default |
6565
| --- | --- | --- |
6666
| `token` | (**required**) A `repo` scoped [PAT](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line). Note: `GITHUB_TOKEN` *does not* work here. See [token](#token) for further details. | |
67-
| `reaction-token` | `GITHUB_TOKEN` or a `repo` scoped [PAT](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line). See [reaction-token](#reaction-token) for further details. | Value of input `token` |
67+
| `reaction-token` | `GITHUB_TOKEN` or a `repo` scoped [PAT](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line). See [reaction-token](#reaction-token) for further details. | `GITHUB_TOKEN` |
6868
| `reactions` | Add reactions. :eyes: = seen, :rocket: = dispatched | `true` |
6969
| `commands` | (**required**) A comma separated list of commands. | |
7070
| `permission` | The repository permission level required by the user to dispatch commands. (`none`, `read`, `write`, `admin`) | `write` |
@@ -84,15 +84,16 @@ If you will be dispatching commands to public repositories *only* then you can u
8484

8585
#### `reaction-token`
8686

87-
If you don't specify a token for `reaction-token` it will use the [PAT](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line) supplied via `token`.
88-
This means that reactions to comments will appear to be made by the user account associated with the PAT. If you prefer to have the @github-actions bot user react to comments you can set `reaction-token` to `GITHUB_TOKEN`.
87+
If you don't specify a token for `reaction-token` it will use the default `GITHUB_TOKEN`.
88+
Reactions to comments will then be made by the @github-actions bot user.
89+
You can use a [PAT](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line) if you would prefer reactions to be made by the user account associated with the PAT.
8990

9091
```yml
9192
- name: Slash Command Dispatch
9293
uses: peter-evans/slash-command-dispatch@v1
9394
with:
9495
token: ${{ secrets.REPO_ACCESS_TOKEN }}
95-
reaction-token: ${{ secrets.GITHUB_TOKEN }}
96+
reaction-token: ${{ secrets.REPO_ACCESS_TOKEN }}
9697
commands: deploy, integration-test, build-docs
9798
```
9899

action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ inputs:
66
required: true
77
reaction-token:
88
description: 'An optional GitHub token to use for reactions.'
9+
default: ${{ github.token }}
910
reactions:
1011
description: 'Add reactions to comments containing commands.'
1112
commands:

0 commit comments

Comments
 (0)