mirror of
https://github.com/ingress-it-solutions/gitea-code-review-action.git
synced 2025-04-20 11:06:47 +00:00
Using @actions/github
This commit is contained in:
parent
7d5b853474
commit
52b842f210
3 changed files with 17 additions and 33 deletions
24
dist/index.js
vendored
24
dist/index.js
vendored
|
@ -39298,25 +39298,17 @@ async function run() {
|
||||||
core.debug(`openai response: ${answer}`);
|
core.debug(`openai response: ${answer}`);
|
||||||
|
|
||||||
// Reply to the review comment with the OpenAI response
|
// Reply to the review comment with the OpenAI response
|
||||||
const octokit = github.getOctokit(githubToken, {
|
const client = new github.GitHub(githubToken, {
|
||||||
baseUrl: githubBaseURL
|
baseUrl: githubBaseURL
|
||||||
});
|
});
|
||||||
const commentUrl = `${githubBaseURL}/repos/${repoOwner}/${repoName}/pulls/${prNumber}`;
|
|
||||||
var response = await axios.post(commentUrl, {
|
await client.issues.createComment({
|
||||||
body: answerTemplate.replace('${answer}', answer),
|
owner: repoOwner,
|
||||||
headers: {
|
repo: repoName,
|
||||||
Authorization: `Bearer ${githubToken}`
|
issue_number: prNumber,
|
||||||
}
|
body: answerTemplate.replace('${answer}', answer)
|
||||||
|
|
||||||
});
|
});
|
||||||
const output = response.data;
|
|
||||||
core.debug(`Output Values: ${output}`);
|
|
||||||
// await octokit.rest.issues.createComment({
|
|
||||||
// owner: repoOwner,
|
|
||||||
// repo: repoName,
|
|
||||||
// issue_number: prNumber,
|
|
||||||
// body: answerTemplate.replace('${answer}', answer)
|
|
||||||
// // in_reply_to: comment.id
|
|
||||||
// });
|
|
||||||
} 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
24
index.js
24
index.js
|
@ -112,25 +112,17 @@ async function run() {
|
||||||
core.debug(`openai response: ${answer}`);
|
core.debug(`openai response: ${answer}`);
|
||||||
|
|
||||||
// Reply to the review comment with the OpenAI response
|
// Reply to the review comment with the OpenAI response
|
||||||
const octokit = github.getOctokit(githubToken, {
|
const client = new github.GitHub(githubToken, {
|
||||||
baseUrl: githubBaseURL
|
baseUrl: githubBaseURL
|
||||||
});
|
});
|
||||||
const commentUrl = `${githubBaseURL}/repos/${repoOwner}/${repoName}/pulls/${prNumber}`;
|
|
||||||
var response = await axios.post(commentUrl, {
|
await client.issues.createComment({
|
||||||
body: answerTemplate.replace('${answer}', answer),
|
owner: repoOwner,
|
||||||
headers: {
|
repo: repoName,
|
||||||
Authorization: `Bearer ${githubToken}`
|
issue_number: prNumber,
|
||||||
}
|
body: answerTemplate.replace('${answer}', answer)
|
||||||
|
|
||||||
});
|
});
|
||||||
const output = response.data;
|
|
||||||
core.debug(`Output Values: ${output}`);
|
|
||||||
// await octokit.rest.issues.createComment({
|
|
||||||
// owner: repoOwner,
|
|
||||||
// repo: repoName,
|
|
||||||
// issue_number: prNumber,
|
|
||||||
// body: answerTemplate.replace('${answer}', answer)
|
|
||||||
// // in_reply_to: comment.id
|
|
||||||
// });
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
core.setFailed(error.message);
|
core.setFailed(error.message);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue