mirror of
https://github.com/mshick/add-pr-comment.git
synced 2025-12-31 14:20:32 +11:00
Add sticky comment feature and ID based reference. (#61)
* sticky comment feature * remove unused param
This commit is contained in:
parent
f9a5a1c8cb
commit
3aa992a9b5
8 changed files with 212 additions and 180 deletions
35
README.md
35
README.md
|
|
@ -4,12 +4,14 @@
|
|||
|
||||
## Features
|
||||
|
||||
- Fast, runs in the GitHub Actions node.js runtime; no Docker pull needed.
|
||||
- Modify issues for PRs merged to master.
|
||||
- Fast, runs in the GitHub Actions node.js runtime.
|
||||
- Modify issues for PRs merged to main.
|
||||
- By default will post "sticky" comments. If on a subsequent run the message text changes the original comment will be updated.
|
||||
- Multiple sticky comments allowed by setting unique `message-id`s.
|
||||
- Multiple posts of the same comment optionally allowable.
|
||||
- Supports emoji 😂😂😂!
|
||||
- Supports a proxy for fork-based PRs. [See below](#proxy-for-fork-based-prs).
|
||||
- Supports creating a message from a file path
|
||||
- Supports creating a message from a file path.
|
||||
|
||||
## Usage
|
||||
|
||||
|
|
@ -32,17 +34,17 @@ jobs:
|
|||
🌏
|
||||
!
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
repo-token-user-login: 'github-actions[bot]' # The user.login for temporary GitHub tokens
|
||||
allow-repeats: false # This is the default
|
||||
message-id: 'add-pr-comment' # This is the default
|
||||
```
|
||||
|
||||
You can even use it on PR Issues that are related to PRs that were merged into master, for example:
|
||||
You can even use it on PR Issues that are related to PRs that were merged into main, for example:
|
||||
|
||||
```yaml
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
|
||||
jobs:
|
||||
test:
|
||||
|
|
@ -55,21 +57,20 @@ jobs:
|
|||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
message: |
|
||||
**Hello MASTER**
|
||||
allow-repeats: true
|
||||
**Hello MAIN**
|
||||
```
|
||||
|
||||
## Configuration options
|
||||
|
||||
| Variable or Argument | Location | Description | Required | Default |
|
||||
| --------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------- | -------- | ------- |
|
||||
| message | with | The message you'd like displayed, supports Markdown and all valid Unicode characters | maybe | |
|
||||
| message-path | with | A path to a message you'd like displayed. Will be read and displayed just like a normal message | maybe | |
|
||||
| repo-token | with | A valid GitHub token, either the temporary token GitHub provides or a personal access token | maybe | |
|
||||
| repo-token-user-login | with | Define this to save on comment processing time when checking for repeats. GitHub's default token uses `github-actions[bot]` | no | |
|
||||
| allow-repeats | with | A boolean flag to allow identical messages to be posted each time this action is run | no | false |
|
||||
| proxy-url | with | A string for your proxy service URL if you'd like this to work with fork-based PRs | no | |
|
||||
| GITHUB_TOKEN | env | A valid GitHub token, can alternatively be defined in the env | maybe | |
|
||||
| Variable or Argument | Location | Description | Required | Default |
|
||||
| -------------------- | -------- | ---------------------------------------------------------------------------------------------------- | -------- | ------- |
|
||||
| message | with | The message you'd like displayed, supports Markdown and all valid Unicode characters. | maybe | |
|
||||
| message-path | with | Path to a message you'd like displayed. Will be read and displayed just like a normal message. | maybe | |
|
||||
| repo-token | with | Valid GitHub token, either the temporary token GitHub provides or a personal access token. | maybe | |
|
||||
| message-id | with | Message id to use when searching existing comments. If found, updates the existing (sticky comment). | no | |
|
||||
| allow-repeats | with | Boolean flag to allow identical messages to be posted each time this action is run. | no | false |
|
||||
| proxy-url | with | String for your proxy service URL if you'd like this to work with fork-based PRs. | no | |
|
||||
| GITHUB_TOKEN | env | Valid GitHub token, can alternatively be defined in the env. | maybe | |
|
||||
|
||||
## Proxy for Fork-based PRs
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue