mirror of
https://github.com/mshick/add-pr-comment.git
synced 2025-12-31 14:20:32 +11:00
build for normal issue support, and deps
This commit is contained in:
parent
01ba04de6a
commit
07f690343c
4 changed files with 2616 additions and 687 deletions
9
dist/index.js
vendored
9
dist/index.js
vendored
|
|
@ -995,7 +995,7 @@ const run = async () => {
|
|||
if (!repoToken) {
|
||||
throw new Error('no github token provided, set one with the repo-token input or GITHUB_TOKEN env variable');
|
||||
}
|
||||
const { payload: { pull_request: pullRequest, repository }, sha: commitSha, } = github.context;
|
||||
const { payload: { pull_request: pullRequest, issue, repository }, sha: commitSha, } = github.context;
|
||||
if (!repository) {
|
||||
core.info('unable to determine repository from request type');
|
||||
core.setOutput('comment-created', 'false');
|
||||
|
|
@ -1004,7 +1004,10 @@ const run = async () => {
|
|||
const { full_name: repoFullName } = repository;
|
||||
const [owner, repo] = repoFullName.split('/');
|
||||
let issueNumber;
|
||||
if (pullRequest && pullRequest.number) {
|
||||
if (issue && issue.number) {
|
||||
issueNumber = issue.number;
|
||||
}
|
||||
else if (pullRequest && pullRequest.number) {
|
||||
issueNumber = pullRequest.number;
|
||||
}
|
||||
else {
|
||||
|
|
@ -1013,7 +1016,7 @@ const run = async () => {
|
|||
issueNumber = commitPullsList && getIssueNumberFromCommitPullsList(commitPullsList);
|
||||
}
|
||||
if (!issueNumber) {
|
||||
core.info('this action only works on pull_request events or other commits associated with a pull');
|
||||
core.info('this action only works on issues and pull_request events or other commits associated with a pull');
|
||||
core.setOutput('comment-created', 'false');
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue