feat: support custom repo (#83)

This commit is contained in:
xrkffgg
2021-08-15 19:55:45 +08:00
committed by GitHub
parent f76bae5b37
commit dc4a7a3ca8
2 changed files with 13 additions and 1 deletions

View File

@@ -65,7 +65,16 @@ const ALLACTIONS = [
async function main() {
try {
const ctx = github.context;
const { owner, repo } = ctx.repo;
// 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;