Skip to content

Commit dea7883

Browse files
authored
Supply chain hardening for npm and actions (#258)
1 parent fd0b127 commit dea7883

19 files changed

+31
-35
lines changed

.github/dependabot.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ updates:
2020
## Ignore all updates for 'zod' as our 'zod' version must match the
2121
## version of 'zod' used by the '@modelcontextprotocol/sdk' dependency.
2222
- dependency-name: 'zod'
23+
## Ignore all updates for '@types/vscode' as its version tracks VS Code
24+
## minor releases and any bump would expose APIs newer than the floor
25+
## declared by 'engines.vscode' in 'extensions/vscode/package.json'.
26+
## Bump this manually together with 'engines.vscode' when raising the
27+
## minimum supported VS Code version.
28+
- dependency-name: '@types/vscode'
2329
versioning-strategy: 'increase'
2430
groups:
2531
all-npm-dependencies:

.github/skills/add-mcp-support-for-new-language/SKILL.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,6 @@ on:
273273
branches: ['main']
274274
paths:
275275
# Same as above
276-
workflow_dispatch:
277276
278277
permissions:
279278
contents: read
@@ -284,12 +283,12 @@ jobs:
284283
runs-on: {os}-latest # e.g., macos-latest, windows-latest
285284
286285
steps:
287-
- uses: actions/checkout@v6
288-
- uses: actions/setup-node@v6
286+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
287+
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
289288
with:
290289
cache: 'npm'
291290
node-version-file: '.node-version'
292-
- run: npm ci --workspaces
291+
- run: npm ci --workspaces --ignore-scripts
293292
- uses: ./.github/actions/setup-codeql-environment
294293
with:
295294
install-language-runtimes: false

.github/skills/add-mcp-support-for-new-language/workflow-template.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ on:
2828
- 'server/scripts/extract-test-databases.sh'
2929
- 'server/scripts/install-packs.sh'
3030
- 'server/scripts/run-query-unit-tests.sh'
31-
workflow_dispatch:
3231

3332
# Prevent duplicate runs from push + PR on the same branch
3433
concurrency:

.github/workflows/build-and-test-extension.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ on:
1919
- 'server/dist/**'
2020
- 'server/ql/*/tools/src/**'
2121
- 'server/src/**'
22-
workflow_dispatch:
2322

2423
permissions:
2524
contents: read
@@ -40,7 +39,7 @@ jobs:
4039
node-version-file: '.node-version'
4140

4241
- name: Install dependencies
43-
run: npm ci --include=optional
42+
run: npm ci --include=optional --ignore-scripts
4443

4544
- name: Build server (dependency)
4645
run: npm run build -w server

.github/workflows/build-server.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ on:
1313
- '.github/workflows/build-server.yml'
1414
- '.node-version'
1515
- 'server/**'
16-
workflow_dispatch:
1716

1817
permissions:
1918
contents: read
@@ -38,7 +37,7 @@ jobs:
3837
node-version-file: '.node-version'
3938

4039
- name: Build Server - Install dependencies
41-
run: npm ci --include=optional
40+
run: npm ci --include=optional --ignore-scripts
4241
working-directory: .
4342

4443
- name: Build Server - Clean previous build

.github/workflows/client-integration-tests.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ on:
1919
- '.node-version'
2020
- 'client/**'
2121
- 'server/**'
22-
workflow_dispatch:
2322

2423
permissions:
2524
contents: read
@@ -61,7 +60,7 @@ jobs:
6160
run: choco install jq -y
6261

6362
- name: MCP Integration Tests - Install node dependencies for client and server workspaces
64-
run: npm ci --workspace=client && npm ci --workspace=server
63+
run: npm ci --workspace=client --ignore-scripts && npm ci --workspace=server --ignore-scripts
6564

6665
- name: MCP Integration Tests - Setup CodeQL environment
6766
uses: ./.github/actions/setup-codeql-environment
@@ -168,7 +167,7 @@ jobs:
168167
node-version-file: '.node-version'
169168

170169
- name: CODEQL_PATH Tests - Install server dependencies
171-
run: npm ci --workspace=server
170+
run: npm ci --workspace=server --ignore-scripts
172171

173172
- name: CODEQL_PATH Tests - Build server bundle
174173
run: npm run bundle -w server

.github/workflows/copilot-setup-steps.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,26 @@
11
name: 'Copilot Setup Steps'
22

33
on:
4-
# Allow manual testing through the repository's "Actions" tab
5-
workflow_dispatch: {}
6-
# Automatically run the setup steps when an associated workflow is changed.
74
push:
85
paths:
96
- '.codeql-version'
7+
- '.github/actions/setup-codeql-environment/action.yml'
108
- '.github/workflows/copilot-setup-steps.yml'
119
- '.node-version'
12-
- '.github/actions/setup-codeql-environment/action.yml'
1310
- '**/codeql-pack.yml'
1411
- '**/codeql-pack.lock.yml'
1512
- '**/package.json'
1613
- '**/package-lock.json'
17-
- '**/qlpack.yml'
1814
pull_request:
1915
paths:
2016
- '.codeql-version'
17+
- '.github/actions/setup-codeql-environment/action.yml'
2118
- '.github/workflows/copilot-setup-steps.yml'
2219
- '.node-version'
23-
- '.github/actions/setup-codeql-environment/action.yml'
2420
- '**/codeql-pack.yml'
2521
- '**/codeql-pack.lock.yml'
2622
- '**/package.json'
2723
- '**/package-lock.json'
28-
- '**/qlpack.yml'
2924

3025
jobs:
3126
# The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot.
@@ -51,7 +46,7 @@ jobs:
5146
node-version-file: '.node-version'
5247

5348
- name: Copilot Setup - Install dependencies
54-
run: npm ci --include=optional
49+
run: npm ci --include=optional --ignore-scripts
5550

5651
- name: Copilot Setup - Setup CodeQL environment
5752
uses: ./.github/actions/setup-codeql-environment

.github/workflows/lint-and-format.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ on:
55
branches: ['main', 'next']
66
push:
77
branches: ['main', 'next']
8-
workflow_dispatch:
98

109
permissions:
1110
contents: read
@@ -26,7 +25,7 @@ jobs:
2625
node-version-file: '.node-version'
2726

2827
- name: Lint and Format - Install node dependencies for all workspaces
29-
run: npm ci
28+
run: npm ci --ignore-scripts
3029

3130
- name: Lint and Format - Run eslint
3231
run: npm run lint

.github/workflows/query-unit-tests-swift.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ on:
2121
- 'server/ql/swift/**'
2222
- 'server/scripts/install-packs.sh'
2323
- 'server/scripts/run-query-unit-tests.sh'
24-
workflow_dispatch:
2524

2625
permissions:
2726
contents: read
@@ -42,7 +41,7 @@ jobs:
4241
node-version-file: '.node-version'
4342

4443
- name: Query Unit Tests - swift - Install node dependencies for all workspaces
45-
run: npm ci --workspaces
44+
run: npm ci --workspaces --ignore-scripts
4645

4746
- name: Query Unit Tests - swift - Setup CodeQL environment
4847
uses: ./.github/actions/setup-codeql-environment

.github/workflows/query-unit-tests.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ on:
2929
- 'server/ql/**'
3030
- 'server/scripts/install-packs.sh'
3131
- 'server/scripts/run-query-unit-tests.sh'
32-
workflow_dispatch:
3332

3433
permissions:
3534
contents: read
@@ -58,7 +57,7 @@ jobs:
5857
run: sudo apt-get install -y jq
5958

6059
- name: Query Unit Tests - ${{ matrix.language }} - Install node dependencies for all workspaces
61-
run: npm ci --workspaces
60+
run: npm ci --workspaces --ignore-scripts
6261

6362
- name: Query Unit Tests - ${{ matrix.language }} - Setup CodeQL environment
6463
uses: ./.github/actions/setup-codeql-environment

0 commit comments

Comments
 (0)