Skip to content

Commit b971888

Browse files
committed
fix(scripts): fail update-export-versions if snapshot update fails
The script was silently swallowing errors when snapshot updates failed, causing versions.ts to be committed without matching snapshots. This led to CI failures in the coverage workflow. Now the script exits with code 1 if snapshot update fails, preventing the mismatched state from being committed.
1 parent fbc8ecd commit b971888

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

scripts/update-export-versions.cjs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,14 @@ const updateSnapshots = () => {
9999
console.log('✅ Snapshots updated successfully!');
100100
} catch (error) {
101101
console.error('❌ Failed to update snapshots:', error.message);
102-
console.log(
103-
'⚠️ Please run "pnpm --filter @openzeppelin/ui-builder-app test src/export/__tests__/ -- -u" manually'
102+
console.error(
103+
'⚠️ Snapshot update failed. This will cause CI failures if versions.ts is committed without matching snapshots.'
104104
);
105+
console.error(
106+
' To fix manually, run: pnpm --filter @openzeppelin/ui-builder-app test src/export/__tests__/ -- -u'
107+
);
108+
// Exit with error code to prevent committing mismatched versions
109+
process.exit(1);
105110
}
106111
};
107112

0 commit comments

Comments
 (0)