chore(repo): fix npm-audit workflow, only run on origin (#28457)

This commit is contained in:
James Henry 2024-10-15 23:38:21 +04:00 committed by GitHub
parent 45b0b7d902
commit 3cab51389f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -8,25 +8,21 @@ on:
permissions: {} permissions: {}
jobs: jobs:
audit: audit:
if: ${{ github.repository_owner == 'nrwl' }}
permissions: permissions:
contents: read # to fetch code (actions/checkout) contents: read # to fetch code (actions/checkout)
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: Install PNPM - uses: pnpm/action-setup@v4
run: | with:
npm install -g @pnpm/exe@8 version: 9.8.0 # Aligned with root package.json (pnpm/action-setup will helpfully error if out of sync)
- name: Run a security audit - name: Run a security audit
run: pnpm dlx audit-ci --critical --report-type summary run: pnpm dlx audit-ci --critical --report-type summary
# - name: Run Dependency confusion supply chain check
# run: npx snync -d .
report: report:
if: ${{ always() && github.repository_owner == 'nrwl' && github.event_name != 'workflow_dispatch' }} if: ${{ always() && github.repository_owner == 'nrwl' && github.event_name != 'workflow_dispatch' }}
needs: audit needs: audit