Skip to content

Commit

Permalink
docs: fix inputs in README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
kkebo committed Oct 11, 2024
1 parent cb13519 commit b17f77a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ It takes only valid reactions and adds it to the comment you've just created. (S

### Specifying which pull request to comment on

You can explicitly input which pull request should be commented on by passing the `pr_number` input.
You can explicitly input which pull request should be commented on by passing the `pr-number` input.
That is particularly useful for manual workflow for instance (`workflow_run`).

```yml
Expand All @@ -67,13 +67,13 @@ That is particularly useful for manual workflow for instance (`workflow_run`).
with:
message: |
Hello world ! :wave:
pr_number: 123 # This will comment on pull request #123
pr-number: 123 # This will comment on pull request #123
```


### 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 +87,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 +119,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

0 comments on commit b17f77a

Please sign in to comment.