From d997be2a3cce23d4474088e86b522c5d76a48ffd Mon Sep 17 00:00:00 2001 From: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com> Date: Tue, 3 Feb 2026 17:26:36 +0530 Subject: [PATCH] chore: add npm audit in CI (#27182) * chore: add npm audit in CI * chore: add npm audit in CI --- .github/workflows/pr.yml | 9 +++++++++ .github/workflows/security-audit.yml | 19 +++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 .github/workflows/security-audit.yml diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index aa36e440ed..e6713a91ca 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -326,6 +326,13 @@ jobs: uses: ./.github/workflows/api-v2-unit-tests.yml secrets: inherit + security-audit: + name: Security Audit + needs: [prepare] + if: ${{ needs.prepare.outputs.has-files-requiring-all-checks == 'true' }} + uses: ./.github/workflows/security-audit.yml + secrets: inherit + check-prisma-migrations: name: Check Prisma Migrations needs: [prepare] @@ -462,6 +469,7 @@ jobs: type-check, unit-test, api-v2-unit-test, + security-audit, check-api-v2-breaking-changes, check-prisma-migrations, integration-test, @@ -504,6 +512,7 @@ jobs: needs.type-check.result != 'success' || needs.unit-test.result != 'success' || needs.api-v2-unit-test.result != 'success' || + needs.security-audit.result != 'success' || (needs.prepare.outputs.has-api-v2-changes == 'true' && needs.check-api-v2-breaking-changes.result != 'success') || (needs.prepare.outputs.has-prisma-changes == 'true' && needs.check-prisma-migrations.result != 'success') || needs.build.result != 'success' || diff --git a/.github/workflows/security-audit.yml b/.github/workflows/security-audit.yml new file mode 100644 index 0000000000..c59d452a07 --- /dev/null +++ b/.github/workflows/security-audit.yml @@ -0,0 +1,19 @@ +name: Security Audit +on: + workflow_call: +permissions: + actions: write + contents: read +jobs: + audit: + runs-on: blacksmith-2vcpu-ubuntu-2404 + steps: + - uses: actions/checkout@v4 + with: + sparse-checkout: .github + - uses: ./.github/actions/cache-checkout + - uses: ./.github/actions/yarn-install + - name: Report all vulnerabilities + run: yarn npm audit --all --recursive || true + - name: Fail on critical vulnerabilities + run: yarn npm audit --all --recursive --severity critical