Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

Commit

Permalink
style: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianschmidt committed May 29, 2020
1 parent 24c8fb7 commit b4347e5
Showing 1 changed file with 27 additions and 9 deletions.
36 changes: 27 additions & 9 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,15 @@ async function run() {
const octokit = new github.GitHub(token);
let runEverything = false;

console.log('\n---\n', JSON.stringify(github.context.payload.pull_request.changed_files, null, 2), '\n---\n\n\n');
console.log(
'\n---\n',
JSON.stringify(
github.context.payload.pull_request.changed_files,
null,
2
),
'\n---\n\n\n'
);

let filenames = [];

Expand All @@ -20,24 +28,34 @@ async function run() {
owner: github.context.payload.repository.owner.login,
repo: github.context.payload.repository.name,
pull_number: github.context.payload.pull_request.number,
per_page: 100
per_page: 100,
});
const paginatedFilenames = files.map(file => file.filename);
const paginatedFilenames = files.map((file) => file.filename);
filenames = [...filenames, ...paginatedFilenames];
} while (filenames.length < github.context.payload.pull_request.changed_files)
} while (
filenames.length < github.context.payload.pull_request.changed_files
);
}

console.log('Changed files:', JSON.stringify(filenames, null, 2));

if (filenames.find(file => file.startsWith('.github/workflows/'))) {
if (filenames.find((file) => file.startsWith('.github/workflows/'))) {
console.log('Workflows updated, running everything!');
runEverything = true;
}

const run_python = runEverything || !!filenames.find(file => !file.startsWith('frontend/'));
const run_admin = runEverything || !!filenames.find(file => file.startsWith('frontend/admin/'));
const run_importer = runEverything || !!filenames.find(file => file.startsWith('frontend/importer/'));
const run_webclient = runEverything || !!filenames.find(file => file.startsWith('frontend/webclient/'));
const run_python =
runEverything ||
!!filenames.find((file) => !file.startsWith('frontend/'));
const run_admin =
runEverything ||
!!filenames.find((file) => file.startsWith('frontend/admin/'));
const run_importer =
runEverything ||
!!filenames.find((file) => file.startsWith('frontend/importer/'));
const run_webclient =
runEverything ||
!!filenames.find((file) => file.startsWith('frontend/webclient/'));

console.log('run_python =', run_python);
console.log('run_admin =', run_admin);
Expand Down

0 comments on commit b4347e5

Please sign in to comment.