mirror of
https://github.com/marocchino/sticky-pull-request-comment.git
synced 2026-04-10 00:10:06 +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
|
|
@ -24,11 +24,11 @@ function run() {
|
|||
return __awaiter(this, void 0, void 0, function* () {
|
||||
try {
|
||||
const repo = github_1.context.repo;
|
||||
const number = (_c = (_b = (_a = github_1.context) === null || _a === void 0 ? void 0 : _a.payload) === null || _b === void 0 ? void 0 : _b.pull_request) === null || _c === void 0 ? void 0 : _c.number;
|
||||
const number = ((_c = (_b = (_a = github_1.context) === null || _a === void 0 ? void 0 : _a.payload) === null || _b === void 0 ? void 0 : _b.pull_request) === null || _c === void 0 ? void 0 : _c.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