Skip to content

Commit 3bbf675

Browse files
committed
Remove unnecessary recursive .npmrc coverage from workflow path filters
For the sake of efficiency, GitHub Workflows should be configured to only be triggered when relevant files are modified. This filtering is done via the `paths` mapping. "Globstar" patterns are supported in paths filters. This will cause the filter to match the matching files in any path under the repository. Previously, this was done for the `.npmrc` npm configuration file in various workflows. Although this is appropriate in the "Check npm" workflow, which supports checking npm-based projects in subfolders of the repository, it is not appropriate for the other workflows which do not have such support (and likely don't need it). In order to improve the efficiency of the workflows, the globstars are removed from the `.npmrc` path filters in the workflows where it is not appropriate.
1 parent 1ad4e40 commit 3bbf675

5 files changed

+10
-10
lines changed

.github/workflows/check-markdown-task.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
paths:
99
- ".github/workflows/check-markdown-task.ya?ml"
1010
- ".markdown-link-check.json"
11+
- ".npmrc"
1112
- "package.json"
1213
- "package-lock.json"
1314
- "Taskfile.ya?ml"
@@ -16,11 +17,11 @@ on:
1617
- "**.mkdn"
1718
- "**.mdown"
1819
- "**.markdown"
19-
- "**/.npmrc"
2020
pull_request:
2121
paths:
2222
- ".github/workflows/check-markdown-task.ya?ml"
2323
- ".markdown-link-check.json"
24+
- ".npmrc"
2425
- "package.json"
2526
- "package-lock.json"
2627
- "Taskfile.ya?ml"
@@ -29,7 +30,6 @@ on:
2930
- "**.mkdn"
3031
- "**.mdown"
3132
- "**.markdown"
32-
- "**/.npmrc"
3333
schedule:
3434
# Run every Tuesday at 8 AM UTC to catch breakage caused by external changes.
3535
- cron: "0 8 * * TUE"

.github/workflows/check-prettier-formatting-task.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ on:
77
push:
88
paths:
99
- ".github/workflows/check-prettier-formatting-task.ya?ml"
10+
- ".npmrc"
1011
- "Taskfile.ya?ml"
11-
- "**/.npmrc"
1212
- "**/.prettierignore"
1313
- "**/.prettierrc*"
1414
# Prettier-covered file patterns are defined by:
@@ -113,8 +113,8 @@ on:
113113
pull_request:
114114
paths:
115115
- ".github/workflows/check-prettier-formatting-task.ya?ml"
116+
- ".npmrc"
116117
- "Taskfile.ya?ml"
117-
- "**/.npmrc"
118118
- "**/.prettierignore"
119119
- "**/.prettierrc*"
120120
# CSS

.github/workflows/check-taskfiles.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@ on:
77
push:
88
paths:
99
- ".github/workflows/check-taskfiles.ya?ml"
10+
- ".npmrc"
1011
- "package.json"
1112
- "package-lock.json"
12-
- "**/.npmrc"
1313
- "**/Taskfile.ya?ml"
1414
- "**/DistTasks.ya?ml"
1515
pull_request:
1616
paths:
1717
- ".github/workflows/check-taskfiles.ya?ml"
18+
- ".npmrc"
1819
- "package.json"
1920
- "package-lock.json"
20-
- "**/.npmrc"
2121
- "**/Taskfile.ya?ml"
2222
- "**/DistTasks.ya?ml"
2323
schedule:

.github/workflows/check-workflows-task.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@ on:
66
push:
77
paths:
88
- ".github/workflows/*.ya?ml"
9+
- ".npmrc"
910
- "package.json"
1011
- "package-lock.json"
1112
- "Taskfile.ya?ml"
12-
- "**/.npmrc"
1313
pull_request:
1414
paths:
1515
- ".github/workflows/*.ya?ml"
16+
- ".npmrc"
1617
- "package.json"
1718
- "package-lock.json"
1819
- "Taskfile.ya?ml"
19-
- "**/.npmrc"
2020
schedule:
2121
# Run every Tuesday at 8 AM UTC to catch breakage resulting from changes to the JSON schema.
2222
- cron: "0 8 * * TUE"

.github/workflows/sync-labels-npm.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ on:
1111
paths:
1212
- ".github/workflows/sync-labels-npm.ya?ml"
1313
- ".github/label-configuration-files/*.ya?ml"
14+
- ".npmrc"
1415
- "package.json"
1516
- "package-lock.json"
16-
- "**/.npmrc"
1717
pull_request:
1818
paths:
1919
- ".github/workflows/sync-labels-npm.ya?ml"
2020
- ".github/label-configuration-files/*.ya?ml"
21+
- ".npmrc"
2122
- "package.json"
2223
- "package-lock.json"
23-
- "**/.npmrc"
2424
schedule:
2525
# Run daily at 8 AM UTC to sync with changes to shared label configurations.
2626
- cron: "0 8 * * *"

0 commit comments

Comments
 (0)