From 9e13f2452ad72719a61329774521e9654dd83768 Mon Sep 17 00:00:00 2001 From: Christian Fehmer Date: Thu, 6 Mar 2025 01:31:33 +0100 Subject: [PATCH] chore: add branch check in release script (@fehmer) (#6338) --- packages/release/src/index.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/release/src/index.js b/packages/release/src/index.js index 098951552..b8892d8fe 100755 --- a/packages/release/src/index.js +++ b/packages/release/src/index.js @@ -55,6 +55,15 @@ const runProjectRootCommand = (command, force) => { }; const checkBranchSync = () => { + console.log("Checking if local branch is master..."); + const currentBranch = runProjectRootCommand("git branch --show-current"); + if (currentBranch !== "master") { + console.error( + "Local branch is not master. Please checkout the master branch." + ); + process.exit(1); + } + console.log("Checking if local master branch is in sync with origin..."); if (noSyncCheck) {