Bladeren bron

CRON builds should send a notification as well.

Kamil Piechaczek 6 jaren geleden
bovenliggende
commit
68918bdb08
1 gewijzigde bestanden met toevoegingen van 13 en 3 verwijderingen
  1. 13 3
      scripts/notify-travis-status.js

+ 13 - 3
scripts/notify-travis-status.js

@@ -21,13 +21,23 @@ It also has some dependencies:
 
 const buildBranch = process.env.TRAVIS_BRANCH;
 
+const acceptedBranches = [
+	'master',
+	'master-revisions'
+];
+
+const acceptedEvents = [
+	'push',
+	'cron'
+];
+
 // Send a notification only for main branches...
-if ( buildBranch !== 'master' && buildBranch !== 'master-revisions' ) {
+if ( !acceptedBranches.includes( buildBranch ) ) {
 	process.exit();
 }
 
-// ...and "push" builds...
-if ( process.env.TRAVIS_EVENT_TYPE !== 'push' ) {
+// ...and an event that triggered the build is correct...
+if ( !acceptedEvents.includes( process.env.TRAVIS_EVENT_TYPE ) ) {
 	process.exit();
 }