Skip to content

Commit

Permalink
ci: add default GITHUB_TOKEN (#138)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasz-mitka committed Oct 13, 2022
1 parent 8d197c9 commit e2fc920
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,4 @@ jobs:
Current branch is `${{ github.head_ref }}`.
_(execution **${{ github.run_id }}** / attempt **${{ github.run_attempt }}**)_
comment_includes: Current branch
reactions: eyes, rocket
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
reactions: eyes, rocket
7 changes: 1 addition & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ jobs:
with:
message: |
Hello world ! :wave:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```


Expand All @@ -41,7 +40,6 @@ It takes only valid reactions and adds it to the comment you've just created. (S
message: |
Hello world ! :wave:
reactions: eyes, rocket
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```

### Specifying which pull request to comment on
Expand All @@ -57,7 +55,6 @@ That is particularly useful for manual workflow for instance (`workflow_run`).
message: |
Hello world ! :wave:
pr_number: 123 # This will comment on pull request #123
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```


Expand All @@ -76,14 +73,12 @@ _That is particularly interesting while committing multiple times in a PR and th
uses: thollander/actions-comment-pull-request@v1
with:
message: 'Loading ...'
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
...
- name: Edit PR comment
uses: thollander/actions-comment-pull-request@v1
with:
message: 'Content loaded ! (edited)'
comment_includes: 'Loading'
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```

## Inputs
Expand All @@ -92,7 +87,7 @@ _That is particularly interesting while committing multiple times in a PR and th

| Name | Description | Required | Default |
| --- | --- | --- | --- |
| `GITHUB_TOKEN` | Token that is used to create comments || |
| `GITHUB_TOKEN` | Token that is used to create comments. Defaults to ${{ github.token }} || |
| `message` | The comment body || |
| `reactions` | List of reactions for the comment (comma separated). See https://docs.github.com/en/rest/reactions#reaction-types | | |
| `pr_number` | The number of the pull request where to create the comment | | current pull request number (deduced from context) |
Expand Down
3 changes: 2 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ inputs:
required: true
GITHUB_TOKEN:
description: 'Github token of the repository (automatically created by Github)'
required: true
default: ${{ github.token }}
required: false
reactions:
description: 'You can set some reactions on your comments through the `reactions` input.'
pr_number:
Expand Down

0 comments on commit e2fc920

Please sign in to comment.