Use only main's data and announcement artifacts for deploys and staging

Merged
LU
1mo ago
+41-20

deploy.yaml and staging-aggregate.yaml downloaded the newest data-artifact from any branch (search_artifacts: true, no branch filter). A manual test run of data-processing.yml on an unreviewed branch could therefore feed the live site, as it did on 3 November (#960).

Changes

  • Artifact downloads: in deploy.yaml (data and announcements), the dawidd6/action-download-artifact searches now add branch: main. In staging-aggregate.yaml (data) the filter is main too, unless a manual run sets the new data_branch input.
  • Staging a pipeline change: run data-processing.yml on the branch, then dispatch staging-aggregate.yaml with data_branch: <branch>, optionally with single_pr. Staging uses that branch's data-artifact-preview, the name #1059 gives branch runs; production never does. If that branch has no artifact, the staging run stops with an error instead of quietly using main's data.
  • Missing-artifact fallback: in both files, it now always dispatches data-processing.yml on main, not on the current ref.
    • It also now fires at all. The first download used if_no_artifact_found: warn, which succeeds, so the fallback, which needs a failure, never ran. It is now fail, with the existing continue-on-error.
    • While waiting, it only follows runs created after its own dispatch (created>= filter), so it can't pick up an older or unrelated main run.
  • Docs: .github/workflows/README.md says that branch artifacts are ignored, and how to try one locally.

Unchanged:

  • link-check.yaml downloads deploy.yaml's output, which only runs on main.
  • Retries by run ID, and everything else in the workflows.

Merge order: merge #1059 (#1030) first. It renames branch-run artifacts to *-preview and owns the create_announcements.yml changes, which this PR no longer touches.

Related

  • #1030 stops branch dispatches writing to build-resources. It is separate and touches data-processing.yml only.
  • On rebrand-doors, deploy.yaml, staging-aggregate.yaml and create_announcements.yml are identical to main's, so the Doors merge keeps this change.
  • rebrand-preview.yaml, on rebrand-doors only, gets the same filter in a separate PR.

Review: Sol checked the branch filter against the source of both pinned versions of the download action, and raised the fallback and retry problems fixed above. Its other finding, that branch runs can still write cached contributor-analysis files to build-resources, which main runs then re-upload, belongs to #1030.

Verified: all three files parse as YAML. The branch input is the action's documented run filter, used alongside search_artifacts. Workflow runs can't be exercised locally, so the first main deploy after merging is the live check: its "Try to download data artifact" log should name a run whose head branch is main.

Fixes #960

šŸ¤– Generated with Claude Code