chore: up 2.4.0 (#84)

* chore: up 2.4.0

* fix: add miss
This commit is contained in:
xrkffgg
2021-08-15 20:24:47 +08:00
committed by GitHub
parent dc4a7a3ca8
commit 3f73e5f3b7
12 changed files with 159 additions and 139 deletions

30
dist/index.js vendored
View File

@@ -11597,10 +11597,22 @@ const ALLACTIONS = [
// **************************************************************************
async function main() {
try {
const owner = github.context.repo.owner;
const repo = github.context.repo.repo;
const ctx = github.context;
const issueNumber = core.getInput('issue-number');
// No display to outside
let owner, repo;
if (core.getInput('repo')) {
owner = core.getInput('repo').split('/')[0];
repo = core.getInput('repo').split('/')[1];
} else {
owner = ctx.repo.owner;
repo = ctx.repo.repo;
}
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.`;
@@ -11623,15 +11635,15 @@ async function main() {
const actions = core.getInput('actions', { required: true });
const actionsArr = actions.split(',');
actionsArr.forEach(item => {
testActions(item.trim());
});
for (const action of actionsArr) {
await testActions(action.trim());
}
function testActions(action) {
async function testActions(action) {
if (ALLACTIONS.includes(action)) {
choseActions(action);
await choseActions(action);
} else {
core.setFailed('This actions not supported!');
core.setFailed(`Actions: [${action}] is not supported!`);
}
}