From 6d3b2ee11f796d3338d5f01ac2a3f61f8b5f6ef1 Mon Sep 17 00:00:00 2001 From: Naren Dasan Date: Fri, 20 May 2022 16:22:02 -0700 Subject: [PATCH] Add PR assigner support Signed-off-by: Naren Dasan --- .github/actions/assigner/dist/index.js | 8 +++++++- .github/actions/assigner/src/main.ts | 7 ++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/actions/assigner/dist/index.js b/.github/actions/assigner/dist/index.js index 5f728771b2..ff9ca2bce5 100644 --- a/.github/actions/assigner/dist/index.js +++ b/.github/actions/assigner/dist/index.js @@ -37,7 +37,13 @@ const fs = __importStar(__nccwpck_require__(7147)); function getIssueNum() { const issue = github.context.payload.issue; if (!issue) { - return undefined; + const pr = github.context.payload.pull_request; + if (!pr) { + return undefined; + } + else { + return pr.number; + } } else { return issue.number; diff --git a/.github/actions/assigner/src/main.ts b/.github/actions/assigner/src/main.ts index 5220b1d34b..aeb8b87952 100644 --- a/.github/actions/assigner/src/main.ts +++ b/.github/actions/assigner/src/main.ts @@ -8,7 +8,12 @@ type GHClient = ReturnType; function getIssueNum(): number | undefined { const issue = github.context.payload.issue; if (!issue) { - return undefined; + const pr = github.context.payload.pull_request; + if (!pr) { + return undefined; + } else { + return pr.number; + } } else { return issue.number; }