Fixed issue with Gitea

This commit is contained in:
Bhavik MacBook PRO 16 2023-04-06 10:07:03 +05:30
parent 52b842f210
commit 7af7c49a6e
3 changed files with 25 additions and 21 deletions

10
dist/index.js vendored
View file

@ -39231,13 +39231,15 @@ async function run() {
const prNumber = github.context.payload.number || github.context.payload.issue.number; // get number from a pull request event or comment event 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 // Get the code to analyze from the review comment
var content = comment && comment.body || "";
const url = `${githubBaseURL}/${repoOwner}/${repoName}/pulls/${prNumber}`;
core.debug(`diff url: ${url}`); 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, { var response = await axios.get(url, {
headers: { headers: {
Authorization: `Bearer ${githubToken}`, Authorization: `token ${giteaToken}`,
Accept: 'application/vnd.github.diff' Accept: 'application/vnd.github.diff'
} }
}); });

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View file

@ -45,13 +45,15 @@ async function run() {
const prNumber = github.context.payload.number || github.context.payload.issue.number; // get number from a pull request event or comment event 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 // Get the code to analyze from the review comment
var content = comment && comment.body || "";
const url = `${githubBaseURL}/${repoOwner}/${repoName}/pulls/${prNumber}`;
core.debug(`diff url: ${url}`); 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, { var response = await axios.get(url, {
headers: { headers: {
Authorization: `Bearer ${githubToken}`, Authorization: `token ${giteaToken}`,
Accept: 'application/vnd.github.diff' Accept: 'application/vnd.github.diff'
} }
}); });