Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add default GITHUB_TOKEN #138

Merged
merged 2 commits into from
Oct 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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