Skip to content

Commit e9d3924

Browse files
committed
feat(ci): skip pushing tags on a dry run
1 parent 7646b34 commit e9d3924

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

packages/build/src/npm-packages/push-tags.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ import { listNpmPackages as listNpmPackagesFn } from './list';
99
import { spawnSync as spawnSyncFn } from '../helpers/spawn-sync';
1010

1111
export function pushTags(
12-
{ useAuxiliaryPackagesOnly }: { useAuxiliaryPackagesOnly: boolean },
12+
{
13+
useAuxiliaryPackagesOnly,
14+
isDryRun,
15+
}: { useAuxiliaryPackagesOnly: boolean; isDryRun: boolean },
1316
listNpmPackages: typeof listNpmPackagesFn = listNpmPackagesFn,
1417
existsVersionTag: typeof existsTag = existsTag,
1518
spawnSync: typeof spawnSyncFn = spawnSyncFn
@@ -68,7 +71,9 @@ export function pushTags(
6871
}
6972
}
7073

71-
spawnSync('git', ['push', '--follow-tags'], commandOptions);
74+
if (!isDryRun) {
75+
spawnSync('git', ['push', '--follow-tags'], commandOptions);
76+
}
7277
}
7378

7479
/** Returns true if the tag exists in the remote repository. */

packages/build/src/publish-auxiliary.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,8 @@ export function publishAuxiliaryPackages(config: Config) {
88
);
99
}
1010
publishToNpm(config);
11-
pushTags({ useAuxiliaryPackagesOnly: true });
11+
pushTags({
12+
useAuxiliaryPackagesOnly: true,
13+
isDryRun: config.isDryRun || false,
14+
});
1215
}

packages/build/src/publish-mongosh.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,10 @@ export async function publishMongosh(
105105
!!config.isDryRun
106106
);
107107

108-
pushTags({ useAuxiliaryPackagesOnly: true });
108+
pushTags({
109+
useAuxiliaryPackagesOnly: true,
110+
isDryRun: config.isDryRun || false,
111+
});
109112

110113
console.info('mongosh: finished release process.');
111114
}

0 commit comments

Comments
 (0)