浏览代码

CRON builds should send a notification as well.

Kamil Piechaczek 6 年之前
父节点
当前提交
68918bdb08
共有 1 个文件被更改,包括 13 次插入3 次删除
  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();
 }