From 7cc2d8b2ea8a75bbf85258f1309ab85d5581e075 Mon Sep 17 00:00:00 2001 From: Ben Elan Date: Thu, 13 Oct 2022 13:43:05 -0700 Subject: [PATCH] ci(prepReleaseCommit): skip git sanity checks for next releases --- support/prepReleaseCommit.ts | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/support/prepReleaseCommit.ts b/support/prepReleaseCommit.ts index 74d21fb7121..e8593f8c786 100644 --- a/support/prepReleaseCommit.ts +++ b/support/prepReleaseCommit.ts @@ -22,20 +22,22 @@ import yargs from "yargs"; const changelogPath = quote([normalize(`${__dirname}/../CHANGELOG.md`)]); const readmePath = quote([normalize(`${__dirname}/../readme.md`)]); + const { next } = yargs(process.argv.slice(2)) + .options({ next: { type: "boolean", default: false } }) + .parseSync(); + if ( - (await exec("git rev-parse --abbrev-ref HEAD")).stdout.trim() !== "master" || - (await exec("git rev-parse master")).stdout.trim() !== (await exec("git rev-parse origin/master")).stdout.trim() || - (await exec("git status --porcelain=v1 2>/dev/null | wc -l")).stdout.trim() !== "0" + !next && // next releases already have sanity checks in `isNextDeployable.ts` + ((await exec("git rev-parse --abbrev-ref HEAD")).stdout.trim() !== "master" || + (await exec("git rev-parse master")).stdout.trim() !== + (await exec("git rev-parse origin/master")).stdout.trim() || + (await exec("git status --porcelain=v1 2>/dev/null | wc -l")).stdout.trim() !== "0") ) { throw new Error( "Make sure the master branch is checked out, in sync with origin, and that there are no uncommitted changes." ); } - const { next } = yargs(process.argv.slice(2)) - .options({ next: { type: "boolean", default: false } }) - .parseSync(); - // deepen the history when fetching tags due to shallow clone await exec("git fetch --deepen=250 --tags");