mirror of
https://gitea.com/Lydanne/issues-helper.git
synced 2025-08-19 18:25:58 +08:00
feat: support custom repo (#83)
This commit is contained in:
@@ -13,6 +13,9 @@ inputs:
|
|||||||
token:
|
token:
|
||||||
description: 'Github_token'
|
description: 'Github_token'
|
||||||
default: ${{ github.token }}
|
default: ${{ github.token }}
|
||||||
|
repo:
|
||||||
|
description: 'The repositorie'
|
||||||
|
|
||||||
issue-number:
|
issue-number:
|
||||||
description: 'Issue-number'
|
description: 'Issue-number'
|
||||||
comment-id:
|
comment-id:
|
||||||
|
11
src/main.js
11
src/main.js
@@ -65,7 +65,16 @@ const ALLACTIONS = [
|
|||||||
async function main() {
|
async function main() {
|
||||||
try {
|
try {
|
||||||
const ctx = github.context;
|
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;
|
let defaultNo;
|
||||||
if (ctx.eventName === 'issues') defaultNo = ctx.payload.issue.number;
|
if (ctx.eventName === 'issues') defaultNo = ctx.payload.issue.number;
|
||||||
|
Reference in New Issue
Block a user