Ignore not affected netlify projecs (#80)

This commit is contained in:
Bartłomiej Głownia 2022-03-14 16:52:02 +01:00 committed by GitHub
parent 1010db6ce4
commit ad5290d8c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

9
ignore-netlify-build.js Normal file
View File

@ -0,0 +1,9 @@
const currentProject = process.env.NX_PROJECT_NAME;
const execSync = require('child_process').execSync;
const getAffected = `nx print-affected`;
const output = execSync(getAffected).toString();
//get the list of changed projects from the output
const changedProjects = JSON.parse(output).projects; // array of affected projects
process.exitCode = changedProjects.some((project) => project === currentProject)
? 0
: 1;

View File

@ -0,0 +1,2 @@
[build]
ignore = "node ignore-netlify-build.js"