Skip to content

Commit

Permalink
Fixed changed files
Browse files Browse the repository at this point in the history
  • Loading branch information
robvanderleek committed Feb 25, 2024
1 parent d28ef18 commit 572d6a3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
11 changes: 8 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,14 @@ runs:
using: 'docker'
image: 'Dockerfile'
inputs:
token:
description: 'GitHub token for repository'
required: true
check:
description: 'Checked changed files'
default: 'true'
required: false
upload:
description: 'Upload report to Code Limit'
required: false
token:
description: 'GitHub token used for upload to Code Limit'
default: 'false'
required: false
6 changes: 3 additions & 3 deletions src/action.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ async function downloadBinary() {
return filename;
}

async function getChangedFiles() {
async function getChangedFiles(token) {
const eventName = context.eventName
if (eventName === undefined) {
return ['.'];
Expand All @@ -55,7 +55,7 @@ async function getChangedFiles() {
}
console.log(`Base commit: ${base}`);
console.log(`Head commit: ${head}`);
const octokit = new Octokit();
const octokit = new Octokit({auth: token});
const response = await octokit.repos.compareCommits({
base, head, owner: context.repo.owner, repo: context.repo.repo
});
Expand Down Expand Up @@ -90,7 +90,7 @@ async function getChangedFiles() {
}
const doCheck = core.getInput('check') || true;
if (doCheck && exitCode === 0) {
const changedFiles = await getChangedFiles();
const changedFiles = await getChangedFiles(token);
console.log(`Number of files changed: ${changedFiles.length}`);
console.log('Running Code Limit...');
exitCode = await exec(filename, ['check'].concat(changedFiles), {ignoreReturnCode: true});
Expand Down

0 comments on commit 572d6a3

Please sign in to comment.