From 731029b8c02a5d3d8d4debd57150252929756986 Mon Sep 17 00:00:00 2001 From: Chris Wilton-Magras Date: Tue, 22 Oct 2024 14:21:56 +0100 Subject: [PATCH] Disable npm audit in CI, skip cloud npm install by default --- .github/workflows/backend-checks.yml | 4 ++-- .github/workflows/cloud.yml | 2 +- .github/workflows/frontend-checks.yml | 4 ++-- .github/workflows/k6-checks.yml | 2 +- cloud/lib/pipeline-stack.ts | 2 +- package.json | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/backend-checks.yml b/.github/workflows/backend-checks.yml index 41a1fca34..80aa7ef56 100644 --- a/.github/workflows/backend-checks.yml +++ b/.github/workflows/backend-checks.yml @@ -34,7 +34,7 @@ jobs: cache-dependency-path: './backend/package-lock.json' - name: Install dependencies run: | - npm ci + npm ci --no-audit - name: Run job run: | npx eslint . @@ -58,7 +58,7 @@ jobs: cache-dependency-path: './backend/package-lock.json' - name: Install dependencies run: | - npm ci + npm ci --no-audit - name: Run job run: | npm run build diff --git a/.github/workflows/cloud.yml b/.github/workflows/cloud.yml index 2e39d3c47..ac4d0f5e1 100644 --- a/.github/workflows/cloud.yml +++ b/.github/workflows/cloud.yml @@ -35,7 +35,7 @@ jobs: cache-dependency-path: './cloud/package-lock.json' - name: Install dependencies run: | - npm ci + npm ci --no-audit - name: Run job run: | npm run codecheck diff --git a/.github/workflows/frontend-checks.yml b/.github/workflows/frontend-checks.yml index b112cb839..1a157c17c 100644 --- a/.github/workflows/frontend-checks.yml +++ b/.github/workflows/frontend-checks.yml @@ -34,7 +34,7 @@ jobs: cache-dependency-path: './frontend/package-lock.json' - name: Install dependencies run: | - npm ci + npm ci --no-audit - name: Run job run: | npx eslint . @@ -59,7 +59,7 @@ jobs: cache-dependency-path: './frontend/package-lock.json' - name: Install dependencies run: | - npm ci + npm ci --no-audit - name: Run job run: | npm run build diff --git a/.github/workflows/k6-checks.yml b/.github/workflows/k6-checks.yml index 06613864c..fa58d4f15 100644 --- a/.github/workflows/k6-checks.yml +++ b/.github/workflows/k6-checks.yml @@ -33,7 +33,7 @@ jobs: cache-dependency-path: './k6/package-lock.json' - name: Install dependencies run: | - npm ci + npm ci --no-audit - name: Run job run: | npx eslint . diff --git a/cloud/lib/pipeline-stack.ts b/cloud/lib/pipeline-stack.ts index 779eabd8f..6b3ece96e 100644 --- a/cloud/lib/pipeline-stack.ts +++ b/cloud/lib/pipeline-stack.ts @@ -61,7 +61,7 @@ export class PipelineStack extends Stack { const pipeline = new CodePipeline(this, generateResourceId('pipeline'), { synth: new ShellStep('Synth', { input: sourceCode, - installCommands: ['npm ci'], + installCommands: ['npm ci', 'cd cloud', 'npm ci --no-audit', 'cd ..'], commands: ['cd cloud', `npm run cdk:synth -- --context STAGE=${stage}`], primaryOutputDirectory: 'cloud/cdk.out', }), diff --git a/package.json b/package.json index ca1d80b34..1002b6aad 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "url": "https://github.com/ScottLogic/prompt-injection/issues" }, "scripts": { - "postinstall": "concurrently \"cd backend && npm ci --no-audit\" \"cd frontend && npm ci --no-audit\" \"cd cloud && npm ci --no-audit\"", + "postinstall": "concurrently \"cd backend && npm ci --no-audit\" \"cd frontend && npm ci --no-audit\"", "build": "concurrently \"cd backend && npm run build\" \"cd frontend && npm run build\"", "start": "cd backend && npm start", "docker:start": "docker compose up -d",