mirror of
https://github.com/ingress-it-solutions/gitea-code-review-action.git
synced 2025-04-20 03:06:44 +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;
|
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
2
dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
15
index.js
15
index.js
|
@ -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) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue