mirror of
https://github.com/ingress-it-solutions/gitea-code-review-action.git
synced 2025-04-20 19:16:47 +00:00
Fixed issue with Comment on Gitea
This commit is contained in:
parent
ba5b9a6177
commit
015e6a0826
3 changed files with 21 additions and 11 deletions
15
dist/index.js
vendored
15
dist/index.js
vendored
|
@ -39357,14 +39357,19 @@ async function run() {
|
||||||
|
|
||||||
|
|
||||||
// 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 comment = answerTemplate.replace('${answer}', answer);
|
||||||
const url = `${githubBaseURL}/api/v1/repos/${repoOwner}/${repoName}/issues/${prNumber}/comments`;
|
const url = `${githubBaseURL}/api/v1/repos/${repoOwner}/${repoName}/issues/${prNumber}/comments`;
|
||||||
const headers = { 'Content-Type': 'application/json', 'Authorization': `token ${githubToken}` };
|
const headers = { 'Content-Type': 'application/json', 'Authorization': `token ${githubToken}` };
|
||||||
const data = { 'body': answerTemplate.replace('${answer}', answer)};
|
const data = { 'body': `${comment}`};
|
||||||
core.debug(`url: ${url}`);
|
core.debug(`url: ${url}`);
|
||||||
core.debug(`headers: ${headers}`);
|
core.debug(`githubToken: ${githubToken}`);
|
||||||
core.debug(`data: ${data}`);
|
core.debug(`data.body: ${data.body}`);
|
||||||
var response = await axios.post(url, data, { headers });
|
var response = await axios.post(url, data, {
|
||||||
|
headers: {
|
||||||
|
Authorization: `token ${githubToken}`,
|
||||||
|
Accept: 'application/json'
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
core.setFailed(error.message);
|
core.setFailed(error.message);
|
||||||
|
|
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
|
@ -171,14 +171,19 @@ async function run() {
|
||||||
|
|
||||||
|
|
||||||
// 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 comment = answerTemplate.replace('${answer}', answer);
|
||||||
const url = `${githubBaseURL}/api/v1/repos/${repoOwner}/${repoName}/issues/${prNumber}/comments`;
|
const url = `${githubBaseURL}/api/v1/repos/${repoOwner}/${repoName}/issues/${prNumber}/comments`;
|
||||||
const headers = { 'Content-Type': 'application/json', 'Authorization': `token ${githubToken}` };
|
const headers = { 'Content-Type': 'application/json', 'Authorization': `token ${githubToken}` };
|
||||||
const data = { 'body': answerTemplate.replace('${answer}', answer)};
|
const data = { 'body': `${comment}`};
|
||||||
core.debug(`url: ${url}`);
|
core.debug(`url: ${url}`);
|
||||||
core.debug(`headers: ${headers}`);
|
core.debug(`githubToken: ${githubToken}`);
|
||||||
core.debug(`data: ${data}`);
|
core.debug(`data.body: ${data.body}`);
|
||||||
var response = await axios.post(url, data, { headers });
|
var response = await axios.post(url, data, {
|
||||||
|
headers: {
|
||||||
|
Authorization: `token ${githubToken}`,
|
||||||
|
Accept: 'application/json'
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
core.setFailed(error.message);
|
core.setFailed(error.message);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue