2019-05-24 23:48:10 +08:00
|
|
|
# Comment on PR via GitHub Action
|
|
|
|
|
|
|
|
A GitHub action to comment on the relevant open PR when a commit is pushed.
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
- Requires the `GITHUB_TOKEN` secret.
|
2019-09-25 23:00:08 +08:00
|
|
|
- Requires the comment's message in the `msg` parameter.
|
2019-12-25 00:49:32 +08:00
|
|
|
- Supports `push` and `pull_request` event types.
|
2019-05-24 23:48:10 +08:00
|
|
|
|
|
|
|
### Sample workflow
|
|
|
|
|
2020-03-30 19:54:33 +08:00
|
|
|
```yaml
|
2019-09-25 23:00:08 +08:00
|
|
|
name: comment-on-pr example
|
|
|
|
on: pull_request
|
|
|
|
jobs:
|
|
|
|
example:
|
|
|
|
name: sample comment
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: comment PR
|
2021-10-16 06:21:43 +08:00
|
|
|
uses: unsplash/comment-on-pr@v1.3.0
|
2019-09-25 23:00:08 +08:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
|
|
|
msg: "Check out this message!"
|
2021-01-02 20:48:51 +08:00
|
|
|
check_for_duplicate_msg: false # OPTIONAL
|
|
|
|
delete_prev_regex_msg: "[0-9]" # OPTIONAL
|
2021-10-02 04:08:55 +08:00
|
|
|
duplicate_msg_pattern: "[A-Z]" # OPTIONAL
|
2019-05-24 23:48:10 +08:00
|
|
|
```
|