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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -67,7 +67,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');
|
||||
|
|
@ -76,7 +76,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 {
|
||||
|
|
@ -85,7 +88,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;
|
||||
}
|
||||
|
|
|
|||
3265
package-lock.json
generated
3265
package-lock.json
generated
File diff suppressed because it is too large
Load diff
20
package.json
20
package.json
|
|
@ -33,20 +33,20 @@
|
|||
"@actions/http-client": "^1.0.8"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@octokit/types": "^5.0.1",
|
||||
"@types/jest": "^26.0.3",
|
||||
"@octokit/types": "^5.4.0",
|
||||
"@types/jest": "^26.0.9",
|
||||
"@types/node": "^12.12.42",
|
||||
"@typescript-eslint/eslint-plugin": "^3.5.0",
|
||||
"@typescript-eslint/parser": "^3.5.0",
|
||||
"@typescript-eslint/eslint-plugin": "^3.9.0",
|
||||
"@typescript-eslint/parser": "^3.9.0",
|
||||
"@zeit/ncc": "^0.22.3",
|
||||
"eslint": "^7.4.0",
|
||||
"eslint": "^7.6.0",
|
||||
"eslint-config-prettier": "^6.11.0",
|
||||
"eslint-plugin-prettier": "^3.1.4",
|
||||
"jest": "^26.1.0",
|
||||
"jest-circus": "^26.1.0",
|
||||
"nock": "^13.0.2",
|
||||
"jest": "^26.3.0",
|
||||
"jest-circus": "^26.3.0",
|
||||
"nock": "^13.0.4",
|
||||
"prettier": "^2.0.5",
|
||||
"ts-jest": "^26.1.1",
|
||||
"typescript": "^3.9.6"
|
||||
"ts-jest": "^26.2.0",
|
||||
"typescript": "^3.9.7"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue