mirror of
https://github.com/ingress-it-solutions/gitea-code-review-action.git
synced 2025-04-20 11:06:47 +00:00
Merge pull request #23 from ingress-it-solutions/dev
Fixed issue with Comment on Gitea
This commit is contained in:
commit
9d0ca9add3
3 changed files with 9 additions and 17 deletions
12
dist/index.js
vendored
12
dist/index.js
vendored
|
@ -39355,22 +39355,18 @@ async function run() {
|
||||||
} else if (sourceAt === 'gitea')
|
} else if (sourceAt === 'gitea')
|
||||||
{
|
{
|
||||||
|
|
||||||
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 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 = { 'Content-Type': 'application/json', 'Authorization': `token ${githubToken}` };
|
||||||
const data = { 'body': comment };
|
const data = { 'body': answerTemplate.replace('${answer}', answer)};
|
||||||
core.debug(`url: ${url}`);
|
core.debug(`url: ${url}`);
|
||||||
core.debug(`headers: ${headers}`);
|
core.debug(`headers: ${headers}`);
|
||||||
core.debug(`data: ${data}`);
|
core.debug(`data: ${data}`);
|
||||||
|
var response = await axios.post(url, data, { headers });
|
||||||
await axios.post(url, data, { headers });
|
|
||||||
|
|
||||||
}
|
}
|
||||||
} 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
2
dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
12
index.js
12
index.js
|
@ -169,22 +169,18 @@ async function run() {
|
||||||
} else if (sourceAt === 'gitea')
|
} else if (sourceAt === 'gitea')
|
||||||
{
|
{
|
||||||
|
|
||||||
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 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 = { 'Content-Type': 'application/json', 'Authorization': `token ${githubToken}` };
|
||||||
const data = { 'body': comment };
|
const data = { 'body': answerTemplate.replace('${answer}', answer)};
|
||||||
core.debug(`url: ${url}`);
|
core.debug(`url: ${url}`);
|
||||||
core.debug(`headers: ${headers}`);
|
core.debug(`headers: ${headers}`);
|
||||||
core.debug(`data: ${data}`);
|
core.debug(`data: ${data}`);
|
||||||
|
var response = await axios.post(url, data, { headers });
|
||||||
await axios.post(url, data, { headers });
|
|
||||||
|
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
core.debug(error.line);
|
|
||||||
core.debug(error.content);
|
|
||||||
core.setFailed(error.message);
|
core.setFailed(error.message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue