Skip to content

ci: rebuild the security watch when the advisory record changes - #36

Merged
stephen-masters merged 1 commit into
mainfrom
ci/refresh-the-watch
Nov 28, 2026
Merged

stephen-masters merged 1 commit into
mainfrom
ci/refresh-the-watch

Conversation

@stephen-masters

Copy link
Copy Markdown
Contributor

Why

The security watch at tetrak.dev/security/ is built from docs/advisories/record.json, which the site fetches from this repository's main each time it is built. Until now a change to the record reached the site only on the Monday rebuild, or when someone pushed to the site's own repository. A triage merged on a Tuesday could wait six days.

With this change, anyone whose triage is merged here publishes it. They need no access to the site's repository or to Cloudflare.

What changes

  • New workflow, watch-refresh.yml. It runs on a push to main that changes docs/advisories/record.json, and on a manual dispatch. It asks Cloudflare Pages to rebuild tetrak.dev through a deploy hook.
  • A five-minute wait before the build. raw.githubusercontent.com serves the record with Cache-Control: max-age=300, so a build requested at once would read the record as it was before the merge. After the wait the job compares what that address serves with this commit's file, and fails without requesting a build if they differ.
  • A paragraph in docs/advisories/README.md telling triagers that a merged record reaches the site by itself, in about ten minutes.

The secret

The hook's URL is the secret CLOUDFLARE_DEPLOY_HOOK on a new tetrak-site environment, which only main may deploy to. A workflow on any other branch cannot read it, and a pull request from a fork never sees it. All the URL can do is ask for a build of the site as it stands. Both the environment and the secret are already set up.

Testing

  • zizmor --min-severity medium .github/workflows, actionlint and zensical build --clean --strict pass locally.
  • The record comparison was run by hand against the live file and matched.
  • The workflow has not run on GitHub yet. This pull request does not touch record.json, so merging it will not trigger it. To test after merging: run "Refresh the security watch" by hand from the Actions tab and check that a deployment named for the hook appears in Cloudflare.

ci: so that no release is cut.

🤖 Generated with Claude Code

The watch at tetrak.dev/security/ is built from docs/advisories/record.json,
fetched from main at build time, and until now a change to the record only
reached the site on the Monday rebuild or when someone pushed to the site's
own repository.

A push to main that changes record.json now asks Cloudflare for a build
through a deploy hook, so a merged triage is published in about ten minutes
and whoever merged it needs no access to the site.

The job waits five minutes first: raw.githubusercontent.com serves the file
with max-age=300, so a build asked for at once would read the old record.
It then checks that the address serves this commit's file and fails rather
than ask for a build that would publish a stale one.

The hook's URL is kept on the tetrak-site environment, which only main may
deploy to, so a workflow on another branch cannot read it.

Co-authored-by: Yvette Mankerian <yvettekm@gmail.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@stephen-masters
stephen-masters merged commit 2d45ea7 into main Nov 28, 2026
11 checks passed
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