Skip to content

Commit

Permalink
Merge pull request #1080 from pytorch/add_pr_assigner_support
Browse files Browse the repository at this point in the history
Add PR assigner support
  • Loading branch information
narendasan authored May 20, 2022
2 parents 3bb5a01 + 6d3b2ee commit 8afbea2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
8 changes: 7 additions & 1 deletion .github/actions/assigner/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 6 additions & 1 deletion .github/actions/assigner/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ type GHClient = ReturnType<typeof github.getOctokit>;
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;
}
Expand Down

0 comments on commit 8afbea2

Please sign in to comment.