Skip to content

Commit 6d3b2ee

Browse files
committed
Add PR assigner support
Signed-off-by: Naren Dasan <[email protected]>
1 parent 3bb5a01 commit 6d3b2ee

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

.github/actions/assigner/dist/index.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,13 @@ const fs = __importStar(__nccwpck_require__(7147));
3737
function getIssueNum() {
3838
const issue = github.context.payload.issue;
3939
if (!issue) {
40-
return undefined;
40+
const pr = github.context.payload.pull_request;
41+
if (!pr) {
42+
return undefined;
43+
}
44+
else {
45+
return pr.number;
46+
}
4147
}
4248
else {
4349
return issue.number;

.github/actions/assigner/src/main.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@ type GHClient = ReturnType<typeof github.getOctokit>;
88
function getIssueNum(): number | undefined {
99
const issue = github.context.payload.issue;
1010
if (!issue) {
11-
return undefined;
11+
const pr = github.context.payload.pull_request;
12+
if (!pr) {
13+
return undefined;
14+
} else {
15+
return pr.number;
16+
}
1217
} else {
1318
return issue.number;
1419
}

0 commit comments

Comments
 (0)