mirror of
https://github.com/ingress-it-solutions/gitea-code-review-action.git
synced 2025-04-18 10:36:44 +00:00
commit
e080dfe7b5
3 changed files with 19 additions and 8 deletions
19
dist/index.js
vendored
19
dist/index.js
vendored
|
@ -39357,15 +39357,20 @@ async function run() {
|
|||
|
||||
const comment = answerTemplate.replace('${answer}', answer);
|
||||
// Make a POST request to create a comment on a pull request
|
||||
const createCommentOnPullRequest = async (repoOwner, repoName, prNumber, comment) => {
|
||||
const url = `${githubBaseURL}/api/v1/repos/${repoOwner}/${repoName}/issues/${prNumber}/comments`;
|
||||
const headers = { 'Authorization': `token ${githubToken}` };
|
||||
const data = { 'body': comment };
|
||||
await axios.post(url, data, { headers });
|
||||
}
|
||||
await createCommentOnPullRequest(repoOwner, repoName, prNumber, comment);
|
||||
|
||||
const url = `${githubBaseURL}/api/v1/repos/${repoOwner}/${repoName}/issues/${prNumber}/comments`;
|
||||
const headers = { 'Authorization': `token ${githubToken}` };
|
||||
const data = { 'body': comment };
|
||||
core.debug(`url: ${url}`);
|
||||
core.debug(`headers: ${headers}`);
|
||||
core.debug(`data: ${data}`);
|
||||
|
||||
await axios.post(url, data, { headers });
|
||||
|
||||
}
|
||||
} catch (error) {
|
||||
core.debug(error.line);
|
||||
core.debug(error.content);
|
||||
core.setFailed(error.message);
|
||||
}
|
||||
}
|
||||
|
|
2
dist/index.js.map
vendored
2
dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
6
index.js
6
index.js
|
@ -175,10 +175,16 @@ async function run() {
|
|||
const url = `${githubBaseURL}/api/v1/repos/${repoOwner}/${repoName}/issues/${prNumber}/comments`;
|
||||
const headers = { 'Authorization': `token ${githubToken}` };
|
||||
const data = { 'body': comment };
|
||||
core.debug(`url: ${url}`);
|
||||
core.debug(`headers: ${headers}`);
|
||||
core.debug(`data: ${data}`);
|
||||
|
||||
await axios.post(url, data, { headers });
|
||||
|
||||
}
|
||||
} catch (error) {
|
||||
core.debug(error.line);
|
||||
core.debug(error.content);
|
||||
core.setFailed(error.message);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue