-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Peter Evans
committed
Nov 24, 2019
1 parent
cbecc49
commit 03a4ec0
Showing
1 changed file
with
69 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,69 @@ | ||
| # create-or-update-comment | ||
| A GitHub action to create or update an issue or pull request comment | ||
| # Create or Update Comment | ||
| [](https://github.com/marketplace/actions/create-or-update-comment) | ||
|
|
||
| A GitHub action to create or update an issue or pull request comment. | ||
|
|
||
| This action was created to help facilitate a GitHub Actions "ChatOps" solution in conjunction with [slash-command-dispatch](https://github.com/peter-evans/slash-command-dispatch) action. | ||
|
|
||
| ## Usage | ||
|
|
||
| ### Add a comment to an issue or pull request | ||
|
|
||
| ```yml | ||
| - name: Create comment | ||
| uses: peter-evans/create-or-update-comment@v1 | ||
| with: | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
| issue-number: 1 | ||
| body: | | ||
| This is a multi-line test comment | ||
| - With GitHub **Markdown** | ||
| - Created by [create-or-update-comment][1] | ||
| [1]: https://github.com/peter-evans/create-or-update-comment | ||
| reaction-type: +1 | ||
| ``` | ||
| ### Update a comment | ||
| ```yml | ||
| - name: Update comment | ||
| uses: peter-evans/create-or-update-comment@v1 | ||
| with: | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
| comment-id: 557858210 | ||
| body: | | ||
| **Edit:** Some additional info | ||
| reaction-type: eyes | ||
| ``` | ||
| ### Add a comment reaction | ||
| ```yml | ||
| - name: Add reaction | ||
| uses: peter-evans/create-or-update-comment@v1 | ||
| with: | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
| comment-id: 557858210 | ||
| reaction-type: heart | ||
| ``` | ||
| ### Action inputs | ||
| | Name | Description | Default | | ||
| | --- | --- | --- | | ||
| | `repository` | The full name of the repository in which to create or update a comment. | Current repository | | ||
| | `issue-number` | The number of the issue or pull request in which to create a comment. | | | ||
| | `comment-id` | The id of the comment to update. | | | ||
| | `body` | The comment body. | | | ||
| | `edit-mode` | The mode when updating a comment, `replace` or `append`. | `append` | | ||
| | `reaction-type` | The reaction to add to the comment. (`+1`, `-1`, `laugh`, `confused`, `heart`, `hooray`, `rocket`, `eyes`) | | | ||
|
|
||
| ### Accessing issues and comments in other repositories | ||
|
|
||
| You can create and update comments in another repository by using a [PAT](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line) instead of `GITHUB_TOKEN`. | ||
| The user associated with the PAT must have write access to the repository. | ||
|
|
||
| ## License | ||
|
|
||
| [MIT](LICENSE) |