From b83d6d259c443f145b2741046cf53ea9990d44dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nedim=20Salki=C4=87?= Date: Fri, 8 Mar 2024 19:34:56 +0100 Subject: [PATCH] fix: release ci failing when there are only empty changesets (#1847) --- .changeset/nine-tomatoes-learn.md | 2 ++ scripts/changeset-version-with-docs.ts | 16 +++++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) create mode 100644 .changeset/nine-tomatoes-learn.md diff --git a/.changeset/nine-tomatoes-learn.md b/.changeset/nine-tomatoes-learn.md new file mode 100644 index 00000000000..a845151cc84 --- /dev/null +++ b/.changeset/nine-tomatoes-learn.md @@ -0,0 +1,2 @@ +--- +--- diff --git a/scripts/changeset-version-with-docs.ts b/scripts/changeset-version-with-docs.ts index b6a4912d955..af4967c5489 100644 --- a/scripts/changeset-version-with-docs.ts +++ b/scripts/changeset-version-with-docs.ts @@ -8,17 +8,19 @@ import { error } from 'console'; // Invoke versions' prebuild script (will rewrite version files if needed) execSync(`pnpm -C packages/versions prebuild`); - // Checks git status - const isGitClean = !execSync(`git status --porcelain`).toString().trim(); + const versionsChanged = !!execSync(`git status --porcelain`).toString().trim(); - // Skip adding/committing/releasing stuff if there's nothing new - if (!isGitClean) { + if (versionsChanged) { execSync(`git add packages/versions/src/lib/getBuiltinVersions.ts`); execSync(`git commit -m"ci(scripts): update versions"`); - - // Run changeset version - execSync(`changeset version`); } + + /** + * This is the base command that has to run always. + * Release CIs were failing when there were only empty changesets because we weren't running this command. + * See more here: https://github.com/FuelLabs/fuels-ts/pull/1847 + */ + execSync(`changeset version`); } catch (err) { error(err.toString()); }