mirror of
https://github.com/marocchino/sticky-pull-request-comment.git
synced 2026-04-08 07:20:05 +00:00
feat: can receive number as input
This commit is contained in:
parent
09865a51d0
commit
6ecc72b81e
4 changed files with 31 additions and 6 deletions
|
|
@ -4,11 +4,12 @@ import { findPreviousComment, createComment, updateComment } from "./comment";
|
|||
async function run() {
|
||||
try {
|
||||
const repo = context.repo;
|
||||
const number = context?.payload?.pull_request?.number;
|
||||
const number =
|
||||
context?.payload?.pull_request?.number || +core.getInput("number");
|
||||
const body = core.getInput("message");
|
||||
const githubToken = core.getInput("GITHUB_TOKEN");
|
||||
if (!number) {
|
||||
core.setFailed("This action only works for pull_request");
|
||||
if (isNaN(number)) {
|
||||
core.setFailed("not found pull request number");
|
||||
return;
|
||||
}
|
||||
if (!body || !githubToken) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue