mirror of
https://github.com/mshick/add-pr-comment.git
synced 2025-12-31 14:20:32 +11:00
chore: repackage
This commit is contained in:
parent
2b326c6656
commit
1936bc3fe4
1 changed files with 3 additions and 8 deletions
11
dist/index.js
vendored
11
dist/index.js
vendored
|
|
@ -1999,8 +1999,6 @@ const getPulls = async (repoToken, repo, commitSha) => {
|
|||
[Headers.Authorization]: `token ${repoToken}`,
|
||||
};
|
||||
|
||||
core.debug(`https://api.github.com/repos/${repo}/commits/${commitSha}/pulls`);
|
||||
|
||||
const response = await http.getJson(
|
||||
`https://api.github.com/repos/${repo}/commits/${commitSha}/pulls`,
|
||||
additionalHeaders
|
||||
|
|
@ -2023,13 +2021,10 @@ async function run() {
|
|||
core.debug(`input allow-repeats: ${allowRepeats}`);
|
||||
|
||||
const {
|
||||
payload: { pull_request: pullRequest, sha, repository },
|
||||
payload: { pull_request: pullRequest, repository },
|
||||
sha: commitSha,
|
||||
} = github.context;
|
||||
|
||||
core.debug(JSON.stringify(github.context));
|
||||
core.debug(JSON.stringify(pullRequest));
|
||||
core.debug(`sha: ${sha}`);
|
||||
|
||||
const { full_name: repoFullName } = repository;
|
||||
|
||||
let issueNumber;
|
||||
|
|
@ -2038,7 +2033,7 @@ async function run() {
|
|||
issueNumber = pullRequest.number;
|
||||
} else {
|
||||
// If this is not a pull request, attempt to find a PR matching the sha
|
||||
const pulls = await getPulls(repoToken, repoFullName, sha);
|
||||
const pulls = await getPulls(repoToken, repoFullName, commitSha);
|
||||
issueNumber = pulls.length ? pulls[0].number : null;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue