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

Fix comment-tag in README.md #399

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
A GitHub action that comments with a given message the pull request linked to the pushed branch.
You can even put dynamic data thanks to [Contexts and expression syntax](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/contexts-and-expression-syntax-for-github-actions).

## Update notice

If you update from `v2` to `v3`, you need to replace `comment_tag` by `comment-tag`.

## Usage

### Classic usage
Expand Down Expand Up @@ -73,7 +77,7 @@ That is particularly useful for manual workflow for instance (`workflow_run`).

### Update a comment

Editing an existing comment is also possible thanks to the `comment_tag` input.
Editing an existing comment is also possible thanks to the `comment-tag` input.

Thanks to this parameter, it will be possible to identify your comment and then to upsert on it.
If the comment is not found at first, it will create a new comment.
Expand All @@ -87,28 +91,28 @@ _That is particularly interesting while committing multiple times in a PR and th
with:
message: |
_(execution **${{ github.run_id }}** / attempt **${{ github.run_attempt }}**)_
comment_tag: execution
comment-tag: execution
```

Note: the input `mode` can be used to either `upsert` (by default) or `recreate` the comment (= delete and create)

### Delete a comment


Deleting a comment with a specific `comment_tag` is possible with the `mode: delete`. If a comment with the `comment_tag` exists, it will be deleted when ran.
Deleting a comment with a specific `comment-tag` is possible with the `mode: delete`. If a comment with the `comment-tag` exists, it will be deleted when ran.

```yml
...
- name: Delete a comment
uses: thollander/actions-comment-pull-request@v3
with:
comment_tag: to_delete
comment-tag: to_delete
mode: delete
```

### Delete a comment on job completion

Deleting an existing comment on job completion is also possible thanks to the `comment_tag` input combined with `mode: delete-on-completion`.
Deleting an existing comment on job completion is also possible thanks to the `comment-tag` input combined with `mode: delete-on-completion`.

This will delete the comment at the end of the job.

Expand All @@ -119,7 +123,7 @@ This will delete the comment at the end of the job.
with:
message: |
The PR is being built...
comment_tag: to_delete_on_completion
comment-tag: to_delete_on_completion
mode: delete-on-completion
```

Expand Down
Loading