test #647
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Audit | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - "main" | |
| - "rc" | |
| - "hotfix-rc" | |
| pull_request: | |
| permissions: | |
| contents: read | |
| jobs: | |
| audit: | |
| name: Run npm audit | |
| if: ${{ startsWith(github.head_ref, 'version_bump_') == false }} | |
| runs-on: ubuntu-24.04 | |
| env: | |
| HUSKY: 0 | |
| steps: | |
| - name: Check out repo | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - name: Get Node version | |
| id: retrieve-node-version | |
| run: | | |
| NODE_NVMRC=$(cat .nvmrc) | |
| NODE_VERSION=${NODE_NVMRC/v/''} | |
| echo "node_version=$NODE_VERSION" >> "$GITHUB_OUTPUT" | |
| - name: Set up Node | |
| uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 | |
| with: | |
| cache: 'npm' | |
| cache-dependency-path: '**/package-lock.json' | |
| node-version: ${{ steps.retrieve-node-version.outputs.node_version }} | |
| - name: Install Node dependencies | |
| run: npm ci | |
| - name: Audit root package | |
| run: npm audit --audit-level=high | |
| - name: Install src-cli Node dependencies | |
| run: npm ci | |
| working-directory: src-cli | |
| - name: Audit src-cli package | |
| run: npm audit --audit-level=high | |
| working-directory: src-cli |