Skip to content

Commit

Permalink
ci(prepReleaseCommit): skip git sanity checks for next releases
Browse files Browse the repository at this point in the history
  • Loading branch information
benelan committed Oct 13, 2022
1 parent 7eaf051 commit 7cc2d8b
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions support/prepReleaseCommit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down

0 comments on commit 7cc2d8b

Please sign in to comment.