mirror of
https://github.com/marocchino/sticky-pull-request-comment.git
synced 2026-02-07 19:47:25 +00:00
Merge c8be55c2a0 into 5060d4700a
This commit is contained in:
commit
cfa6d5f2c9
6 changed files with 29 additions and 5 deletions
17
README.md
17
README.md
|
|
@ -91,6 +91,19 @@ If for some reason, triggering on pr is not possible, you can use push.
|
|||
This message is from a push.
|
||||
```
|
||||
|
||||
### Override pull request number
|
||||
|
||||
Use `number_force` to comment on a different pull request than the one that triggered the event.
|
||||
|
||||
```yaml
|
||||
- uses: marocchino/sticky-pull-request-comment@v2
|
||||
with:
|
||||
number_force: 123
|
||||
message: |
|
||||
This comment will be posted to PR #123,
|
||||
regardless of which PR triggered this workflow.
|
||||
```
|
||||
|
||||
### Read comment from a file
|
||||
|
||||
```yaml
|
||||
|
|
@ -217,6 +230,10 @@ For more detailed information about permissions, you can read from the link belo
|
|||
|
||||
**Optional** Pull request number for push event. Note that this has a **lower priority** than the number of a pull_request event.
|
||||
|
||||
### `number_force`
|
||||
|
||||
**Optional** Pull request number for any event. Note that this has the **highest priority** and will override the number from a pull_request event.
|
||||
|
||||
### `owner`
|
||||
|
||||
**Optional** Another repository owner, If not set, the current repository owner is used by default. Note that when you trying changing a repo, be aware that `GITHUB_TOKEN` should also have permission for that repository.
|
||||
|
|
|
|||
|
|
@ -72,6 +72,9 @@ inputs:
|
|||
number:
|
||||
description: "pull request number for push event"
|
||||
required: false
|
||||
number_force:
|
||||
description: "pull request number for any event"
|
||||
required: false
|
||||
owner:
|
||||
description: "Another repo owner, If not set, the current repo owner is used by default. Note that when you trying changing a repo, be aware that GITHUB_TOKEN should also have permission for that repository."
|
||||
required: false
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "https://biomejs.dev/schemas/2.0.4/schema.json",
|
||||
"$schema": "https://biomejs.dev/schemas/2.3.4/schema.json",
|
||||
"files": {
|
||||
"includes": ["src/**/*.ts"]
|
||||
},
|
||||
|
|
|
|||
6
dist/index.js
generated
vendored
6
dist/index.js
generated
vendored
|
|
@ -213,7 +213,9 @@ const node_fs_1 = __nccwpck_require__(3024);
|
|||
const core = __importStar(__nccwpck_require__(7484));
|
||||
const github_1 = __nccwpck_require__(3228);
|
||||
const glob_1 = __nccwpck_require__(7206);
|
||||
exports.pullRequestNumber = github_1.context?.payload?.pull_request?.number || +core.getInput("number", { required: false });
|
||||
exports.pullRequestNumber = +core.getInput("number_force", { required: false }) ||
|
||||
github_1.context?.payload?.pull_request?.number ||
|
||||
+core.getInput("number", { required: false });
|
||||
exports.repo = buildRepo();
|
||||
exports.header = core.getInput("header", { required: false });
|
||||
exports.append = core.getBooleanInput("append", { required: true });
|
||||
|
|
@ -9138,7 +9140,7 @@ function expand(str, isTop) {
|
|||
var isOptions = m.body.indexOf(',') >= 0;
|
||||
if (!isSequence && !isOptions) {
|
||||
// {a},b}
|
||||
if (m.post.match(/,.*\}/)) {
|
||||
if (m.post.match(/,(?!,).*\}/)) {
|
||||
str = m.pre + '{' + m.body + escClose + m.post;
|
||||
return expand(str);
|
||||
}
|
||||
|
|
|
|||
2
dist/index.js.map
generated
vendored
2
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
|
|
@ -5,7 +5,9 @@ import {create} from "@actions/glob"
|
|||
import type {ReportedContentClassifiers} from "@octokit/graphql-schema"
|
||||
|
||||
export const pullRequestNumber =
|
||||
context?.payload?.pull_request?.number || +core.getInput("number", {required: false})
|
||||
+core.getInput("number_force", {required: false}) ||
|
||||
context?.payload?.pull_request?.number ||
|
||||
+core.getInput("number", {required: false})
|
||||
|
||||
export const repo = buildRepo()
|
||||
export const header = core.getInput("header", {required: false})
|
||||
|
|
|
|||
Loading…
Reference in a new issue