Skip to content

Commit 9e13f24

Browse files
authored
chore: add branch check in release script (@fehmer) (monkeytypegame#6338)
1 parent 25dada5 commit 9e13f24

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

packages/release/src/index.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,15 @@ const runProjectRootCommand = (command, force) => {
5555
};
5656

5757
const checkBranchSync = () => {
58+
console.log("Checking if local branch is master...");
59+
const currentBranch = runProjectRootCommand("git branch --show-current");
60+
if (currentBranch !== "master") {
61+
console.error(
62+
"Local branch is not master. Please checkout the master branch."
63+
);
64+
process.exit(1);
65+
}
66+
5867
console.log("Checking if local master branch is in sync with origin...");
5968

6069
if (noSyncCheck) {

0 commit comments

Comments
 (0)