feat: support default issueNumber get from context (#81)

This commit is contained in:
xrkffgg
2021-08-13 14:46:48 +08:00
committed by GitHub
parent b395ad434f
commit f76bae5b37
3 changed files with 32 additions and 29 deletions

View File

@@ -64,10 +64,13 @@ const ALLACTIONS = [
// **************************************************************************
async function main() {
try {
const owner = github.context.repo.owner;
const repo = github.context.repo.repo;
const ctx = github.context;
const { owner, repo } = ctx.repo;
const issueNumber = core.getInput('issue-number');
let defaultNo;
if (ctx.eventName === 'issues') defaultNo = ctx.payload.issue.number;
const issueNumber = core.getInput('issue-number') || defaultNo;
const commentId = core.getInput('comment-id');
const defaultBody = `Currently at ${owner}/${repo}. And this is default comment.`;