Daily CVE overview #11
Workflow file for this run
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: Daily CVE overview | |
| env: | |
| issue: 9999 | |
| on: | |
| schedule: | |
| - cron: '30 1 * * *' # Runs daily at 01:30 UTC | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| audit: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - base: develop | |
| version: v4 | |
| - base: release/3 | |
| version: v3 | |
| - base: release/2 | |
| version: v2 | |
| - base: release/1 | |
| version: v1 | |
| env: | |
| version: ${{ matrix.version }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| ref: ${{ matrix.base }} | |
| persist-credentials: false | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 22 | |
| - uses: pnpm/action-setup@v4 | |
| id: pnpm-install | |
| with: | |
| version: 10 | |
| run_install: false | |
| - name: Get pnpm store directory | |
| id: pnpm-cache | |
| shell: bash | |
| run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | |
| - uses: actions/cache@v5 | |
| with: | |
| path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} | |
| key: ${{ runner.os }}-pnpm-store | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm-store | |
| - name: Install | |
| run: pnpm i --frozen-lockfile | |
| - name: Run audit (production) | |
| run: pnpm audit --json --production > audit-prod.json || true | |
| - name: Run audit (all dependencies) | |
| run: pnpm audit --json > audit-all.json || true | |
| - name: Upload audit results | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: cve-audit-${{ matrix.version }} | |
| path: | | |
| audit-prod.json | |
| audit-all.json | |
| publish: | |
| runs-on: ubuntu-latest | |
| needs: audit | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| ref: ${{ github.sha }} | |
| persist-credentials: false | |
| - name: Download audit results | |
| uses: actions/download-artifact@v5 | |
| with: | |
| path: audits | |
| - name: Merge CVE overview | |
| run: node scripts/merge-cve-overview.mjs --output docs/CVE-OVERVIEW.md --audit-prod-v1 audits/cve-audit-v1/audit-prod.json --audit-v1 audits/cve-audit-v1/audit-all.json --audit-prod-v2 audits/cve-audit-v2/audit-prod.json --audit-v2 audits/cve-audit-v2/audit-all.json --audit-prod-v3 audits/cve-audit-v3/audit-prod.json --audit-v3 audits/cve-audit-v3/audit-all.json --audit-prod-v4 audits/cve-audit-v4/audit-prod.json --audit-v4 audits/cve-audit-v4/audit-all.json | |
| - name: Clean up audit artifacts | |
| run: rm -rf audits/ | |
| - name: Check for changes | |
| id: verify-changed-files | |
| run: | | |
| if git diff --quiet docs/CVE-OVERVIEW.md; then | |
| echo "changed=false" >> $GITHUB_OUTPUT | |
| else | |
| echo "changed=true" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Commit changes | |
| if: steps.verify-changed-files.outputs.changed == 'true' | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add docs/CVE-OVERVIEW.md | |
| git commit -m "chore: update CVE overview" | |
| - name: Create Pull Request | |
| if: steps.verify-changed-files.outputs.changed == 'true' | |
| uses: peter-evans/create-pull-request@v8 | |
| with: | |
| base: develop | |
| branch: ${{ env.issue }}/cve-overview | |
| commit-message: 'chore: update CVE overview' | |
| title: 'chore: update CVE overview' | |
| body: 'Automated CVE overview update from issue #${{ env.issue }}.' | |
| delete-branch: true |