feat: can receive number as input

This commit is contained in:
marocchino 2019-12-18 13:53:53 +09:00
parent 09865a51d0
commit 6ecc72b81e
No known key found for this signature in database
GPG key ID: AFF521DBDB122570
4 changed files with 31 additions and 6 deletions

View file

@ -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) {