Skip to content

Commit

Permalink
ci(danger): update danger to warn if toptimodule.m is changed
Browse files Browse the repository at this point in the history
  • Loading branch information
ewanharris committed Mar 13, 2019
1 parent 3d784ad commit 3ab4ab6
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions dangerfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,13 @@ async function checkJIRA() {
// Check that if we modify the Android or iOS SDK, we also update the tests
// Also, assign labels based on changes to different dir paths
async function checkChangedFileLocations() {
let modifiedTopTiModule = false;
const modified = danger.git.modified_files.concat(danger.git.created_files);
const modifiedAndroidFiles = modified.filter(p => p.startsWith('android/') && p.endsWith('.java'));
const modifiedIOSFiles = modified.filter(p => {
if (p.endsWith('TopTiModule.m')) {
modifiedTopTiModule = true;
}
return p.startsWith('iphone/') && (p.endsWith('.h') || p.endsWith('.m'));
});

Expand Down Expand Up @@ -100,6 +104,11 @@ async function checkChangedFileLocations() {
// If it has the "needs tests" label, remove it
labelsToRemove.add(Label.NEEDS_TESTS);
}

if (modifiedTopTiModule) {
warn('It looks like you have modified the TopTiModule.m file. Are you sure you meant to do that?');
}

}

// Does the PR have merge conflicts?
Expand Down

0 comments on commit 3ab4ab6

Please sign in to comment.