Skip to content

Commit

Permalink
fix: release ci failing when there are only empty changesets (#1847)
Browse files Browse the repository at this point in the history
  • Loading branch information
nedsalk authored Mar 8, 2024
1 parent 468b4cf commit b83d6d2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .changeset/nine-tomatoes-learn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
16 changes: 9 additions & 7 deletions scripts/changeset-version-with-docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down

0 comments on commit b83d6d2

Please sign in to comment.