Skip to content

Daily CVE overview

Daily CVE overview #4

Workflow file for this run

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
env:
version: ${{ matrix.version }}
steps:
- uses: actions/checkout@v6
with:
ref: develop
path: tools
- uses: actions/checkout@v6
with:
ref: ${{ matrix.base }}
path: repo
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
working-directory: repo
run: pnpm i --frozen-lockfile
- name: Run audit
working-directory: repo
run: pnpm audit --json --production > audit-prod.json || true
- name: Run audit (all dependencies)
working-directory: repo
run: pnpm audit --json > audit-all.json || true
- name: Generate report
run: node tools/scripts/generate-cve-report.mjs --input-prod repo/audit-prod.json --input-all repo/audit-all.json --label ${{ matrix.version }} --output report-${{ matrix.version }}.md
- name: Upload report
uses: actions/upload-artifact@v4
with:
name: cve-report-${{ matrix.version }}
path: report-${{ matrix.version }}.md
publish:
runs-on: ubuntu-latest
needs: audit
steps:
- uses: actions/checkout@v6
with:
ref: develop
persist-credentials: false
- name: Download reports
uses: actions/download-artifact@v5
with:
path: reports
- name: Merge overview
run: node scripts/merge-cve-overview.mjs --output doc/cve-overview.md --input reports/cve-report-v2/report-v2.md --input reports/cve-report-v3/report-v3.md --input reports/cve-report-v4/report-v4.md
- name: Check for changes
id: verify-changed-files
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "changed=true" >> $GITHUB_OUTPUT
else
echo "changed=false" >> $GITHUB_OUTPUT
fi
- 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