Skip to content

Commit 2c0c719

Browse files
committed
refactor(ng-dev/release): centralize and expand ignored paths for snapshot publishing
Centralizes the paths to exclude when detecting changes for snapshot publishing into a single constant. Additionally, adds `pubspec.lock` to the list of ignored files to avoid unnecessary snapshot releases when only lock files change.
1 parent a1923f6 commit 2c0c719

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ interface SnapshotRepo {
3131
containsChanges: boolean;
3232
}
3333

34+
/**
35+
* Paths to exclude from the snapshot commit.
36+
*/
37+
const PATHS_TO_EXCLUDE = ['**/MODULE.bazel.lock', '**/package-lock.json', '**/pubspec.lock'];
38+
3439
export class SnapshotPublisher {
3540
/** The current branch name. */
3641
readonly branchName = this.git.getCurrentBranchOrRevision();
@@ -166,8 +171,7 @@ export class SnapshotPublisher {
166171
'HEAD',
167172
'--',
168173
'.',
169-
':(exclude)**/MODULE.bazel.lock',
170-
':(exclude)**/package-lock.json',
174+
...PATHS_TO_EXCLUDE.map((p) => `:(exclude)${p}`),
171175
],
172176
{cwd: tmpRepoDir},
173177
).status === 1;

0 commit comments

Comments
 (0)