Skip to content

Commit 947165f

Browse files
Use for '--ignore-scripts' for all npm ci & npm install (graphql#3405)
1 parent ce4277e commit 947165f

File tree

5 files changed

+18
-16
lines changed

5 files changed

+18
-16
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
node-version: ${{ env.NODE_VERSION_USED_FOR_DEVELOPMENT }}
1818

1919
- name: Install Dependencies
20-
run: npm ci
20+
run: npm ci --ignore-scripts
2121

2222
- name: Lint ESLint
2323
run: npm run lint
@@ -62,7 +62,7 @@ jobs:
6262
node-version: ${{ env.NODE_VERSION_USED_FOR_DEVELOPMENT }}
6363

6464
- name: Run npm install
65-
run: npm install --engine-strict --strict-peer-deps
65+
run: npm install --ignore-scripts --engine-strict --strict-peer-deps
6666

6767
- name: Check that package-lock.json is in sync with package.json
6868
run: git diff --exit-code package-lock.json
@@ -85,7 +85,7 @@ jobs:
8585
# so we skip cache action to not pollute cache for other jobs.
8686

8787
- name: Install Dependencies
88-
run: npm ci
88+
run: npm ci --ignore-scripts
8989

9090
- name: Run Integration Tests
9191
run: npm run check:integrations
@@ -104,7 +104,7 @@ jobs:
104104
node-version: ${{ env.NODE_VERSION_USED_FOR_DEVELOPMENT }}
105105

106106
- name: Install Dependencies
107-
run: npm ci
107+
run: npm ci --ignore-scripts
108108

109109
- name: Run Tests
110110
run: npm run fuzzonly
@@ -123,7 +123,7 @@ jobs:
123123
node-version: ${{ env.NODE_VERSION_USED_FOR_DEVELOPMENT }}
124124

125125
- name: Install Dependencies
126-
run: npm ci
126+
run: npm ci --ignore-scripts
127127

128128
- name: Run tests and measure code coverage
129129
run: npm run testonly:cover
@@ -152,7 +152,7 @@ jobs:
152152
node-version: ${{ matrix.node_version_to_setup }}
153153

154154
- name: Install Dependencies
155-
run: npm ci
155+
run: npm ci --ignore-scripts
156156

157157
- name: Run Tests
158158
run: npm run testonly
@@ -173,7 +173,7 @@ jobs:
173173
node-version: ${{ env.NODE_VERSION_USED_FOR_DEVELOPMENT }}
174174

175175
- name: Install Dependencies
176-
run: npm ci
176+
run: npm ci --ignore-scripts
177177

178178
- name: Run Benchmark
179179
run: 'npm run benchmark -- --revs HEAD HEAD~1'
@@ -194,7 +194,7 @@ jobs:
194194
node-version: ${{ env.NODE_VERSION_USED_FOR_DEVELOPMENT }}
195195

196196
- name: Install Dependencies
197-
run: npm ci
197+
run: npm ci --ignore-scripts
198198

199199
- name: Generate report
200200
run: 'node resources/diff-npm-package.js $BASE_COMMIT HEAD'
@@ -227,7 +227,7 @@ jobs:
227227
node-version: ${{ env.NODE_VERSION_USED_FOR_DEVELOPMENT }}
228228

229229
- name: Install Dependencies
230-
run: npm ci
230+
run: npm ci --ignore-scripts
231231

232232
- name: Build NPM package
233233
run: npm run build:npm
@@ -256,7 +256,7 @@ jobs:
256256
node-version: ${{ env.NODE_VERSION_USED_FOR_DEVELOPMENT }}
257257

258258
- name: Install Dependencies
259-
run: npm ci
259+
run: npm ci --ignore-scripts
260260

261261
- name: Build Deno package
262262
run: npm run build:deno

benchmark/benchmark.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,10 @@ function prepareBenchmarkProjects(revisionList) {
5858
path.join(projectPath, 'package.json'),
5959
'{ "private": true }',
6060
);
61-
exec('npm --quiet install ' + prepareNPMPackage(revision), {
62-
cwd: projectPath,
63-
});
61+
exec(
62+
'npm --quiet install --ignore-scripts ' + prepareNPMPackage(revision),
63+
{ cwd: projectPath },
64+
);
6465
exec(`cp -R ${localDir('benchmark')} ${projectPath}`);
6566

6667
return { revision, projectPath };
@@ -86,7 +87,7 @@ function prepareBenchmarkProjects(revisionList) {
8687
fs.rmSync(repoDir, { recursive: true, force: true });
8788
fs.mkdirSync(repoDir);
8889
exec(`git archive "${hash}" | tar -xC "${repoDir}"`);
89-
exec('npm --quiet ci', { cwd: repoDir });
90+
exec('npm --quiet ci --ignore-scripts', { cwd: repoDir });
9091
fs.renameSync(buildNPMArchive(repoDir), archivePath);
9192
fs.rmSync(repoDir, { recursive: true });
9293
return archivePath;

integrationTests/integration-test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ describe('Integration Tests', () => {
3737
exec(`cp -R ${projectPath} ${tmpDir}`);
3838

3939
const cwd = path.join(tmpDir, projectName);
40+
// TODO: figure out a way to run it with --ignore-scripts
4041
exec('npm --quiet install', { cwd, stdio: 'inherit' });
4142
exec('npm --quiet test', { cwd, stdio: 'inherit' });
4243
}).timeout(60000);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"node": "^12.22.0 || ^14.16.0 || >=16.0.0"
3131
},
3232
"scripts": {
33-
"preversion": ". ./resources/checkgit.sh && npm ci",
33+
"preversion": ". ./resources/checkgit.sh && npm ci --ignore-scripts",
3434
"version": "node resources/gen-version.js && npm test && git add src/version.ts",
3535
"fuzzonly": "mocha --full-trace src/**/__tests__/**/*-fuzz.ts",
3636
"changelog": "node resources/gen-changelog.js",

resources/diff-npm-package.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ function prepareNPMPackage(revision) {
8989
fs.rmSync(repoDir, { recursive: true, force: true });
9090
fs.mkdirSync(repoDir);
9191
exec(`git archive "${hash}" | tar -xC "${repoDir}"`);
92-
exec('npm --quiet ci', { cwd: repoDir });
92+
exec('npm --quiet ci --ignore-scripts', { cwd: repoDir });
9393
exec('npm --quiet run build:npm', { cwd: repoDir });
9494
return path.join(repoDir, 'npmDist');
9595
}

0 commit comments

Comments
 (0)