From 01c4e2b439782d8a64766bc76f86dfe210e80410 Mon Sep 17 00:00:00 2001 From: Nad Alaba <37968805+nadalaba@users.noreply.github.com> Date: Tue, 31 Mar 2026 22:16:45 +0300 Subject: [PATCH 1/2] fix release script failing in dry run --- packages/release/src/index.js | 71 ++++++++++++++++------------------- 1 file changed, 33 insertions(+), 38 deletions(-) diff --git a/packages/release/src/index.js b/packages/release/src/index.js index b1b8a908d693..6c55181e6bdb 100755 --- a/packages/release/src/index.js +++ b/packages/release/src/index.js @@ -59,11 +59,15 @@ const runProjectRootCommand = (command, force) => { }; const checkBranchSync = () => { + if (noSyncCheck) { + console.log("Skipping sync check."); + return; + } console.log("Checking if local branch is master..."); const currentBranch = runProjectRootCommand( "git branch --show-current", ).trim(); - if (currentBranch !== "master") { + if (currentBranch !== "master" && !isDryRun) { console.error( "Local branch is not master. Please checkout the master branch.", ); @@ -72,32 +76,26 @@ const checkBranchSync = () => { console.log("Checking if local master branch is in sync with origin..."); - if (noSyncCheck) { - console.log("Skipping sync check."); - } else if (isDryRun) { - console.log("[Dry Run] Checking sync..."); - } else { - try { - // Fetch the latest changes from the remote repository - runProjectRootCommand("git fetch origin"); - - // Get the commit hashes of the local and remote master branches - const localMaster = runProjectRootCommand("git rev-parse master").trim(); - const remoteMaster = runProjectRootCommand( - "git rev-parse origin/master", - ).trim(); - - if (localMaster !== remoteMaster) { - console.error( - "Local master branch is not in sync with origin. Please pull the latest changes before proceeding.", - ); - process.exit(1); - } - } catch (error) { - console.error("Error checking branch sync status."); - console.error(error); + try { + // Fetch the latest changes from the remote repository + runProjectRootCommand("git fetch origin"); + + // Get the commit hashes of the local and remote master branches + const localMaster = runProjectRootCommand("git rev-parse master").trim(); + const remoteMaster = runProjectRootCommand( + "git rev-parse origin/master", + ).trim(); + + if (localMaster !== remoteMaster && !isDryRun) { + console.error( + "Local master branch is not in sync with origin. Please pull the latest changes before proceeding.", + ); process.exit(1); } + } catch (error) { + console.error("Error checking branch sync status."); + console.error(error); + process.exit(1); } }; @@ -156,9 +154,8 @@ const updatePackage = (newVersion) => { const checkUncommittedChanges = () => { console.log("Checking uncommitted changes..."); const status = execSync("git status --porcelain").toString().trim(); - if (isDryRun) { - console.log("[Dry Run] Checking uncommitted changes..."); - } else if (status) { + + if (status && !isDryRun) { console.error( "You have uncommitted changes. Please commit or stash them before proceeding.", ); @@ -168,11 +165,7 @@ const checkUncommittedChanges = () => { const installDependencies = () => { console.log("Installing dependencies..."); - if (isDryRun) { - console.log("[Dry Run] Dependencies would be installed."); - } else { - runProjectRootCommand("pnpm i"); - } + runProjectRootCommand("pnpm i"); }; const buildProject = () => { @@ -233,11 +226,13 @@ const generateContributors = () => { contributors.replaceAll("\n", "").replace(/^.*?\[/, "["), ); - fs.writeFileSync( - `${PROJECT_ROOT}/frontend/static/contributors.json`, - JSON.stringify(contributors, null, 2), - "utf8", - ); + if (!isDryRun) { + fs.writeFileSync( + `${PROJECT_ROOT}/frontend/static/contributors.json`, + JSON.stringify(contributors, null, 2), + "utf8", + ); + } console.log("Contributors list updated."); } catch (e) { From d8a47353034d147aa082acfcbb8f0c1273c6c23f Mon Sep 17 00:00:00 2001 From: Nad Alaba <37968805+nadalaba@users.noreply.github.com> Date: Wed, 8 Apr 2026 22:06:00 +0300 Subject: [PATCH 2/2] let the release script format fetched contributors data --- packages/release/src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/release/src/index.js b/packages/release/src/index.js index 6c55181e6bdb..afc413023e1e 100755 --- a/packages/release/src/index.js +++ b/packages/release/src/index.js @@ -244,7 +244,7 @@ const generateContributors = () => { const createCommitAndTag = (version) => { console.log("Creating commit and tag... Pushing to Github..."); runCommand(`git add .`); - runCommand(`git commit -m "chore: release ${version}" --no-verify`); + runCommand(`git commit -m "chore: release ${version}"`); runCommand(`git tag ${version}`); runCommand(`git push origin master --tags --no-verify`); };