Skip to content

Commit 48beea0

Browse files
committed
fix(ng-dev/release): improve lockfile exclusion logic in snapshot publishing
Update the snapshot publishing logic to more robustly exclude lockfiles from determining if a snapshot is affected by changes. Specifically: - Added pnpm-lock.yaml to the list of excluded paths. - Added both root-level and glob variants for MODULE.bazel.lock, pnpm-lock.yaml, and pubspec.lock. - Wrapped exclude pathspecs in quotes to ensure they are correctly interpreted by the git command.
1 parent 929d4f4 commit 48beea0

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

ng-dev/release/snapshot-publish/snapshots.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,16 @@ interface SnapshotRepo {
3434
/**
3535
* Paths to exclude from the snapshot commit.
3636
*/
37-
const PATHS_TO_EXCLUDE = ['**/MODULE.bazel.lock', '**/package-lock.json', '**/pubspec.lock'];
37+
const PATHS_TO_EXCLUDE = [
38+
'MODULE.bazel.lock',
39+
'**/MODULE.bazel.lock',
40+
41+
'pnpm-lock.yaml',
42+
'**/pnpm-lock.yaml',
43+
44+
'pubspec.lock',
45+
'**/pubspec.lock',
46+
];
3847

3948
export class SnapshotPublisher {
4049
/** The current branch name. */
@@ -171,7 +180,7 @@ export class SnapshotPublisher {
171180
'HEAD',
172181
'--',
173182
'.',
174-
...PATHS_TO_EXCLUDE.map((p) => `:(exclude)${p}`),
183+
...PATHS_TO_EXCLUDE.map((p) => `':(exclude)${p}'`),
175184
],
176185
{cwd: tmpRepoDir},
177186
).status === 1;

0 commit comments

Comments
 (0)