Fixed issue with Comment on Gitea

This commit is contained in:
Bhavik MacBook PRO 16 2023-04-23 19:02:59 +05:30
parent 9c01da5f63
commit b540e7ba2a
2 changed files with 13 additions and 8 deletions

11
dist/index.js vendored
View file

@ -39357,15 +39357,20 @@ 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 };
core.debug(`url: ${url}`);
core.debug(`headers: ${headers}`);
core.debug(`data: ${data}`);
await axios.post(url, data, { headers }); await axios.post(url, data, { headers });
}
await createCommentOnPullRequest(repoOwner, repoName, prNumber, comment);
} }
} catch (error) { } catch (error) {
core.debug(error.line);
core.debug(error.content);
core.setFailed(error.message); core.setFailed(error.message);
} }
} }

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long