Fixed issue with Comment on Gitea

This commit is contained in:
Bhavik MacBook PRO 16 2023-04-23 18:50:43 +05:30
parent 8543fc0e11
commit c6fb986f1e
3 changed files with 8 additions and 9 deletions

2
dist/index.js vendored
View file

@ -39358,7 +39358,7 @@ 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 // Make a POST request to create a comment on a pull request
const createCommentOnPullRequest = async (repoOwner, repoName, prNumber, comment) => { const createCommentOnPullRequest = async (repoOwner, repoName, prNumber, comment) => {
const url = `${githubBaseURL}/repos/${repoOwner}/${repoName}/issues/${prNumber}/comments`; const url = `${githubBaseURL}/api/v1/repos/${repoOwner}/${repoName}/issues/${prNumber}/comments`;
const headers = { 'Authorization': `token ${githubToken}` }; const headers = { 'Authorization': `token ${githubToken}` };
const data = { 'body': comment }; const data = { 'body': comment };
await axios.post(url, data, { headers }); await axios.post(url, data, { headers });

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View file

@ -171,13 +171,12 @@ 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 // 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 url = `${githubBaseURL}/api/v1/repos/${repoOwner}/${repoName}/issues/${prNumber}/comments`;
const headers = { 'Authorization': `token ${githubToken}` }; const headers = { 'Authorization': `token ${githubToken}` };
const data = { 'body': comment }; const data = { 'body': comment };
await axios.post(url, data, { headers }); await axios.post(url, data, { headers });
}
await createCommentOnPullRequest(repoOwner, repoName, prNumber, comment);
} }
} catch (error) { } catch (error) {
core.setFailed(error.message); core.setFailed(error.message);