fix(ci): make Verdaccio staging idempotent
CI / build (pull_request) Successful in 32s

Stage only release branches and preserve immutable versions. Repeated identical candidates now exit successfully, while content changes under an existing version require a prerelease bump.

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
This commit is contained in:
chrnx committed 2026-08-02 22:38:56 -05:00
1 parent dbb996dd4c
commit 29aafde84c
4 files changed
+74 -11

No files matched your search

+13
View File
@@ -0,0 +1,13 @@
export type StagingAction = 'publish' | 'skip';
export function decideStagingPublish(localIntegrity: string, existingIntegrity?: string): StagingAction {
if (existingIntegrity === undefined) return 'publish';
if (existingIntegrity === localIntegrity) return 'skip';
throw new Error('Version already exists in Verdaccio with different contents');
}
if (require.main === module) {
const [, , localIntegrity, existingIntegrity] = process.argv;
console.log(decideStagingPublish(localIntegrity, existingIntegrity));
}