Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
save
  • Loading branch information
Nikhil Thorat committed Sep 9, 2019
commit 0d72e0120a5143146060f4d16c8a1ddc629ea1e6
16 changes: 6 additions & 10 deletions scripts/diff.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ const dirs = readdirSync('.').filter(f => {
return f !== 'node_modules' && f !== '.git' && statSync(f).isDirectory();
});

console.log('REPO NAME', process.env['REPO_NAME']);
let commitSha = process.env['COMMIT_SHA'];
let branchName = process.env['BRANCH_NAME'];
// If commit sha or branch name are null we are running this locally and are in
Expand All @@ -47,14 +46,13 @@ console.log('branchName: ', branchName);

// We cannot do --depth=1 here because we need to check out an old merge base.
// We cannot do --single-branch here because we need multiple branches.
exec(
`git clone ` +
`https://github.com/tensorflow/tfjs ${CLONE_PATH}`);
exec(`git clone https://github.com/tensorflow/tfjs ${CLONE_PATH}`);

console.log(); // Break up the console for readability.

shell.cd(CLONE_PATH);

// If we cannot check out the commit given by cloud CI then this PR is coming
// from a fork.
// If we cannot check out the commit then this PR is coming from a fork.
const res = shell.exec(`git checkout ${commitSha}`);
const isPullRequestFromFork = res.code !== 0;

Expand Down Expand Up @@ -84,8 +82,7 @@ filesWhitelistToTriggerBuild.forEach(fileToTriggerBuild => {
}
});

// Break up the console for readability.
console.log();
console.log(); // Break up the console for readability.

let triggeredBuilds = [];
dirs.forEach(dir => {
Expand All @@ -105,8 +102,7 @@ dirs.forEach(dir => {
}
});

// Break up the console for readability.
console.log();
console.log(); // Break up the console for readability.

// Filter the triggered builds to log by whether a cloudbuild.yml file
// exists for that directory.
Expand Down