mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-07 04:12:04 +00:00
ci: take the dependency audit off pull requests
`pnpm audit --prod` answers a question about the published advisory database, not about the diff. The same lockfile passes on Monday and fails on Tuesday because someone else published, and the branch that turns red changed nothing: seventeen of the forty-one Security & Quality failures in the last thirty days were advisory publications on branches that touched no dependency (GHSA-jqff-g426-hqxp, GHSA-fph4-wmhf-6fwf, GHSA-f65p-4m7j-42xc and GHSA-5jgf-p345-68v8 in one run alone). A gate that fails for a reason the author cannot act on is a gate people re-run instead of read. It keeps running on every push to `main` and once a day on a new schedule trigger, which is the cadence the question actually has. The other three jobs sit out the scheduled run. Nothing about what ships is loosened: the container scan still builds and scans the image on every push to `main`, and the daily Trivy workflow still scans the lockfile with dev dependencies included and the published image. Gate — the trigger set, read back from the parsed workflow: triggers: push, pull_request, schedule quality | if: github.event_name != 'schedule' dependency-audit | if: github.event_name != 'pull_request' secret-scan | if: github.event_name != 'schedule' docker-security | if: github.event_name == 'push' && github.ref == 'refs/heads/main'
This commit is contained in:
1 parent
59108e09fa
commit
d48bbff01d
2 files changed
+20
-1
No files matched your search
@@ -5,6 +5,11 @@ on:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
schedule:
|
||||
# Daily, 05:47 UTC. Carries the dependency audit only — every other job
|
||||
# here answers "is this change safe" and has nothing to say about a tree
|
||||
# nobody touched. See the note on `dependency-audit`.
|
||||
- cron: "47 5 * * *"
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
@@ -13,6 +18,7 @@ jobs:
|
||||
quality:
|
||||
name: Lint, Typecheck & Test
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event_name != 'schedule'
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
@@ -81,9 +87,21 @@ jobs:
|
||||
fi
|
||||
echo "::notice::OpenAPI spec in sync with Zod source schemas."
|
||||
|
||||
# Not on pull requests. `pnpm audit` answers a question about the published
|
||||
# advisory database, not about the diff: the same lockfile passes on Monday
|
||||
# and fails on Tuesday because someone else published, and the branch that
|
||||
# goes red changed nothing. Seventeen of the forty-one failures this workflow
|
||||
# produced in thirty days were exactly that, and a gate that fails for
|
||||
# reasons the author cannot act on is a gate people learn to re-run rather
|
||||
# than read. It runs on every push to `main` and once a day on the schedule
|
||||
# above, which is the cadence the question actually has. What ships is still
|
||||
# gated: `docker-security` scans the built image on every push to `main`, and
|
||||
# `trivy.yml` scans the lockfile (dev dependencies included) and the
|
||||
# published image daily.
|
||||
dependency-audit:
|
||||
name: Dependency Audit
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event_name != 'pull_request'
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
@@ -109,6 +127,7 @@ jobs:
|
||||
secret-scan:
|
||||
name: Secret Scanning
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event_name != 'schedule'
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
|
||||
@@ -4,7 +4,7 @@ name: Trivy Scheduled Scan
|
||||
#
|
||||
# What already exists and is NOT repeated here:
|
||||
# - `security.yml` → `dependency-audit` runs `pnpm audit --prod` on every
|
||||
# push and pull request, blocking on HIGH/CRITICAL.
|
||||
# push to `main` and once a day, blocking on HIGH/CRITICAL.
|
||||
# - `security.yml` → `docker-security` builds the image on a push to `main`
|
||||
# and runs `trivy image` against it, blocking on HIGH/CRITICAL.
|
||||
#
|
||||
|
||||
Reference in new issue
Block a user