mirror of
https://github.com/ingress-it-solutions/gitea-code-review-action.git
synced 2025-04-19 18:56:45 +00:00
Fixed issue with Gitea
This commit is contained in:
parent
52b842f210
commit
7af7c49a6e
3 changed files with 25 additions and 21 deletions
22
dist/index.js
vendored
22
dist/index.js
vendored
|
@ -39230,17 +39230,19 @@ async function run() {
|
|||
const repoOwner = github.context.payload.repository.owner.login;
|
||||
const prNumber = github.context.payload.number || github.context.payload.issue.number; // get number from a pull request event or comment event
|
||||
|
||||
// Get the code to analyze from the review comment
|
||||
var content = comment && comment.body || "";
|
||||
// Get the code to analyze from the review comment
|
||||
|
||||
const url = `${githubBaseURL}/${repoOwner}/${repoName}/pulls/${prNumber}`;
|
||||
core.debug(`diff url: ${url}`);
|
||||
var response = await axios.get(url, {
|
||||
headers: {
|
||||
Authorization: `Bearer ${githubToken}`,
|
||||
Accept: 'application/vnd.github.diff'
|
||||
}
|
||||
});
|
||||
|
||||
var content = comment && comment.body || '';
|
||||
|
||||
const url = `${giteaBaseURL}/api/v1/repos/${repoOwner}/${repoName}/pulls/${prNumber}/diff`;
|
||||
console.log(`diff url: ${url}`);
|
||||
var response = await axios.get(url, {
|
||||
headers: {
|
||||
Authorization: `token ${giteaToken}`,
|
||||
Accept: 'application/vnd.github.diff'
|
||||
}
|
||||
});
|
||||
const code = response.data;
|
||||
core.debug(`diff code: ${code}`);
|
||||
const files = parsePullRequestDiff(code);
|
||||
|
|
2
dist/index.js.map
vendored
2
dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
22
index.js
22
index.js
|
@ -44,17 +44,19 @@ async function run() {
|
|||
const repoOwner = github.context.payload.repository.owner.login;
|
||||
const prNumber = github.context.payload.number || github.context.payload.issue.number; // get number from a pull request event or comment event
|
||||
|
||||
// Get the code to analyze from the review comment
|
||||
var content = comment && comment.body || "";
|
||||
// Get the code to analyze from the review comment
|
||||
|
||||
const url = `${githubBaseURL}/${repoOwner}/${repoName}/pulls/${prNumber}`;
|
||||
core.debug(`diff url: ${url}`);
|
||||
var response = await axios.get(url, {
|
||||
headers: {
|
||||
Authorization: `Bearer ${githubToken}`,
|
||||
Accept: 'application/vnd.github.diff'
|
||||
}
|
||||
});
|
||||
|
||||
var content = comment && comment.body || '';
|
||||
|
||||
const url = `${giteaBaseURL}/api/v1/repos/${repoOwner}/${repoName}/pulls/${prNumber}/diff`;
|
||||
console.log(`diff url: ${url}`);
|
||||
var response = await axios.get(url, {
|
||||
headers: {
|
||||
Authorization: `token ${giteaToken}`,
|
||||
Accept: 'application/vnd.github.diff'
|
||||
}
|
||||
});
|
||||
const code = response.data;
|
||||
core.debug(`diff code: ${code}`);
|
||||
const files = parsePullRequestDiff(code);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue