mirror of
https://github.com/ingress-it-solutions/gitea-code-review-action.git
synced 2025-04-19 18:56:45 +00:00
Added code for Gitea
This commit is contained in:
parent
c6912e4ece
commit
6344cae339
3 changed files with 17 additions and 15 deletions
15
dist/index.js
vendored
15
dist/index.js
vendored
|
@ -39201,13 +39201,7 @@ function configWithProxy(config) {
|
|||
return c;
|
||||
}
|
||||
|
||||
// Make a POST request to create a comment on a pull request
|
||||
const createCommentOnPullRequest = async (repoOwner, repoName, prNumber, comment) => {
|
||||
const url = `${giteaBaseURL}/repos/${repoOwner}/${repoName}/issues/${prNumber}/comments`;
|
||||
const headers = { 'Authorization': `token ${giteaToken}` };
|
||||
const data = { 'body': comment };
|
||||
await axios.post(url, data, { headers });
|
||||
}
|
||||
|
||||
|
||||
async function run() {
|
||||
try {
|
||||
|
@ -39362,6 +39356,13 @@ 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}/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);
|
||||
}
|
||||
} catch (error) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue