Skip to content

ci(deps): daily dependency advisory check files one issue when the release gate fails - #1217

Merged
nc9 merged 1 commit into
mainfrom
ci/daily-dependency-advisory
Oct 28, 2026
Merged

nc9 merged 1 commit into
mainfrom
ci/daily-dependency-advisory

Conversation

@nc9

@nc9 nc9 commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

A new advisory can turn bun run audit:dependencies red on main with nobody changing anything (satori on 10-27, deepmerge on 10-28), and the first anyone learned of it was a blocked merge and release. This runs the same audit on main every day (cron plus workflow_dispatch) in the same setup the CI job uses.

On failure it opens or updates ONE issue, Dependency advisory fails the release gate, labelled dependency-advisory, with the audit's own output (advisory ids, severities, the workspace paths that reach them; ANSI stripped, fenced so it cannot add markup, capped at 40 kB) and a literal ## Acceptance Criteria checklist (advisory resolved by an upgrade or an ignore with a reason; audit passes on main). It closes the issue and comments when the audit passes again. Same one-open-issue pattern as the installer canary: the label plus author and exact-title checks are the identity, so a stranger's issue with the same title is never touched.

  • Permissions: contents read, issues write, job level; no secrets beyond the workflow token; action versions pinned by SHA as in ci.yml; runs only on squirrelscan/squirrelscan.
  • The run goes red when the audit fails, so it also shows in the Actions tab.
  • actionlint clean; no em-dashes.

Docs: none. Skill: no change.

@claude

claude Bot commented Oct 28, 2026

Copy link
Copy Markdown

Review: the workflow looks sound. I found nothing that should block merging. I read the diff and checked that the audit:dependencies script and the setup-bun action exist. I did not run the workflow.

  • (low) dependency-advisory.yml (audit step): any non-zero exit from bun run audit:dependencies is treated as an advisory failure. A registry outage, rate limit or network error in bun audit would open an issue with the acceptance criteria 'resolve each advisory'. A later successful run closes it again, so the damage is noise only. Consider a line in the issue body saying that, if the output lists no advisories, the cause may be transient.
  • (nit) head -c 40000 can cut a multibyte UTF-8 character at the end of the output. GitHub tolerates this. Add a 'truncated' marker if the output is cut, so readers know the list may be incomplete.
  • (nit) In the audit step, bun run output goes to a file, so the Actions log has nothing from the audit. Piping through tee would keep the output visible in the run log, which helps when you debug without opening the issue.
  • (nit) The red-run step fails the job after the issue is filed. That is intended. If the issue-filing step itself fails, the job still goes red because set -e applies, so a failed issue-filing step is not silent.

The tilde-fence escaping, the label plus author plus title identity, the SHA-pinned checkout and the job-level permissions all look right and match installer-canary.yml.

…release-gate audit fails on main

Signed-off-by: Nik Cubrilovic <[email protected]>
@nc9
nc9 force-pushed the ci/daily-dependency-advisory branch from cc70b8b to 036828d Compare October 28, 2026 00:32
@claude

claude Bot commented Oct 28, 2026

Copy link
Copy Markdown

Review of the daily dependency advisory workflow. The overall design is sound: one issue, identity by label plus author plus exact title, SHA-pinned actions, job-level permissions, a fork guard, and untrusted audit output fenced and capped. I found two things worth fixing.

  • (medium) dependency-advisory.yml (the sed ... | head -c 40000 line): the step runs under set -euo pipefail. If the audit output is larger than 40 kB, head exits early, sed gets SIGPIPE (141), and pipefail aborts the step before the issue is created or updated. The cap exists to protect exactly the big-output case, so that case is where the issue would silently not be filed. Only the red run would show. Fix: write sed ... > audit-clean-full.txt first and then head -c 40000 audit-clean-full.txt > audit-clean.txt, or append || true to the pipeline.
  • (low) The audit step treats any non-zero exit as an advisory failure. bun run audit:dependencies can also fail because the advisory endpoint is unreachable (a transient network error or a registry outage). That would open or update an issue titled as an advisory failure, with no advisory in it. Consider checking that the output contains GHSA- or a severity line before filing, or rewording the issue for the unknown-failure case. Alternatively, skip the issue and only fail the run.
  • (nit) head -c can cut a multi-byte UTF-8 character at the 40 kB boundary, which leaves a replacement character at the end of the fence. It is harmless, but you could mention truncation in the issue body when the cap is hit.
  • (nit) The tilde-to-dash replacement is fine for the fence. A 4-tilde fence only needs the content not to contain a line starting with 4 or more tildes, so the replacement is stricter than necessary, but it does no harm.

No tests apply to this change. The PR says actionlint is clean, and I did not re-run it.

@nc9
nc9 merged commit a5860f6 into main Oct 28, 2026
15 checks passed
@nc9
nc9 deleted the ci/daily-dependency-advisory branch October 28, 2026 00:47
nc9 added a commit that referenced this pull request Oct 28, 2026
* origin/main:
  feat(contracts): free plan renders 2 pages at once, up from 1 (#1207)
  ci(deps): daily dependency advisory check files one issue when the release gate fails (#1217)
  docs(rules): the SEO rules page counts 26 structured data rules (#1213)
  build(deps): ignore GHSA-gcqx-w48m-w2h4 (deepmerge via ultracite, dev tooling only) to unblock the release gate (#1216)
  chore(release): v0.0.138 notes and version bump (#1212)
  feat(report,rules): link sections, component-aware findings, fix rollups, Page structure block (#1181)
  fix(classifier): parse homepage URLs safely, backslash paths are not the root (#1206)
  build(deps): ignore GHSA-wx4j-mvgx-mqwp (satori, docs build only) to unblock the release gate (#1210)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant