Abort if not on -stable branch
Christopher Chedeau committed
Sep 27, 2016 at 11:55 UTC
6db38a143c2c906b30d2e32572ba92d1e47f9975
1 file changed
+11
scripts/release-manager/commands/docs-prs.js
+11
@@ -25,6 +25,17 @@ module.exports = function(vorpal, app) {
25
.command('docs-prs')
26
.description('Get list of documentation pull requests that need to be merged to the stable branch')
27
.action(function(args, actionCB) {
28
+ const branch = git.getBranch(app);
29
+ if (!branch.match(/-stable$/)) {
30
+ this.log(chalk.red('Aborting...'));
31
+ this.log(
32
+ `You need to be on the latest stable branch in the React repo ` +
33
+ `to execute this command.\nYou are currently in ${branch}.`
34
+ );
35
+ actionCB();
36
+ return;
37
+ }
38
+
39
const query = {
40
labels: [DOCS_LABEL].join(), // github-api doesn't join automatically
41
state: 'closed',