Added code for Gitea

This commit is contained in:
Bhavik MacBook PRO 16 2023-04-23 16:49:26 +05:30
parent c6912e4ece
commit 6344cae339
3 changed files with 17 additions and 15 deletions

15
dist/index.js vendored
View file

@ -39201,13 +39201,7 @@ function configWithProxy(config) {
return c; 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() { async function run() {
try { try {
@ -39362,6 +39356,13 @@ async function run() {
{ {
const comment = answerTemplate.replace('${answer}', answer); 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); await createCommentOnPullRequest(repoOwner, repoName, prNumber, comment);
} }
} catch (error) { } catch (error) {

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View file

@ -15,13 +15,7 @@ function configWithProxy(config) {
return c; 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() { async function run() {
try { try {
@ -176,6 +170,13 @@ async function run() {
{ {
const comment = answerTemplate.replace('${answer}', answer); 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); await createCommentOnPullRequest(repoOwner, repoName, prNumber, comment);
} }
} catch (error) { } catch (error) {