Skip to content

Commit f4488be

Browse files
authored
Add skipCI flag to release script (facebook#13933)
1 parent d42ed60 commit f4488be

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

scripts/release/build-commands/check-circle-ci-status.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
const chalk = require('chalk');
66
const http = require('request-promise-json');
7+
const logUpdate = require('log-update');
8+
const prompt = require('prompt-promise');
79
const {execRead, logPromise} = require('../utils');
810

911
// https://circleci.com/docs/api/v1-reference/#projects
@@ -46,5 +48,21 @@ module.exports = async params => {
4648
if (params.local) {
4749
return;
4850
}
51+
52+
if (params.skipCI) {
53+
logUpdate(chalk.red`Are you sure you want to skip CI? (y for yes, n for no)`);
54+
const confirm = await prompt('');
55+
logUpdate.done();
56+
if (confirm === 'y') {
57+
return;
58+
} else {
59+
throw Error(
60+
chalk`
61+
Cancelling release.
62+
`
63+
);
64+
}
65+
}
66+
4967
return logPromise(check(params), 'Checking CircleCI status');
5068
};

scripts/release/build-commands/update-git.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ module.exports = async params => {
2121
update(params),
2222
`Updating checkout ${chalk.yellow.bold(
2323
params.cwd
24-
)} on branch ${chalk.yellow.bold(params.branch)}}`
24+
)} on branch ${chalk.yellow.bold(params.branch)}`
2525
);
2626
};

scripts/release/config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ const paramDefinitions = [
4343
'The npm dist tag; defaults to [bold]{latest} for a stable' +
4444
'release, [bold]{next} for unstable',
4545
},
46+
{
47+
name: 'skipCI',
48+
type: Boolean,
49+
description:
50+
'Skip Circle CI status check (requires confirmation)',
51+
},
4652
];
4753

4854
module.exports = {

0 commit comments

Comments
 (0)