Commit 18999df7 by Dominik Prokop

Ensuring master branch when performing release

parent 73ef8649
......@@ -83,7 +83,19 @@ const publishPackage = (name: string, version: string) =>
await execa('npm', ['publish', '--access', 'public']);
})();
const ensureMasterBranch = async () => {
const currentBranch = await execa.stdout('git', ['symbolic-ref', '--short', 'HEAD']);
const status = await execa.stdout('git', ['status', '--porcelain']);
console.log(status === '');
if (currentBranch !== 'master' && status !== '') {
console.error(chalk.red.bold('You need to be on clean master branch to release @grafana/ui'));
process.exit(1);
}
};
const releaseTaskRunner: TaskRunner<ReleaseTaskOptions> = async ({ publishToNpm }) => {
await ensureMasterBranch();
await execTask(buildTask)();
let releaseConfirmed = false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment