ci: run one pipeline per push to main - #35
Conversation
Both main.yml and release.yml triggered on push to main and each defined its own verify job and its own scan caller, so every commit ran the whole gate twice: two verifies and eight scan jobs, each a fetch-depth: 0 clone plus a Docker pull. Fold main.yml into release.yml, the file npm Trusted Publishing binds to. One verify (now the same definition verify.yml gives pull requests) and one scan, with deploy and release as siblings on needs: [verify, scan]. Deploy still never depends on release: publication failure must not stop attach.uinaf.dev from shipping.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
🟢 Approval recommended
The consolidation cleanly removes duplicated push-to-main CI while preserving the existing required contexts and keeping deploy independent from release.
Pull request overview
This PR de-duplicates CI on pushes to main by consolidating the push pipeline into .github/workflows/release.yml, reusing the same verify definition that guards PRs, and deleting the redundant main.yml workflow.
Changes:
- Make
.github/workflows/verify.ymlreusable viaworkflow_calland adjust concurrency cancellation to avoid canceling superseded push-to-main gates. - Move the push-to-main gate (
verify,scan,deploy) into.github/workflows/release.ymlso only one pipeline runs per commit. - Update docs to reflect that pushes to
mainnow run viarelease.yml(and remove references tomain.yml).
File summaries
| File | Description |
|---|---|
| docs/releasing.md | Updates release documentation to reflect a single push-to-main workflow pipeline in release.yml. |
| docs/deploy.md | Updates deploy documentation to reference release.yml instead of main.yml. |
| .github/workflows/verify.yml | Adds workflow_call so the same verify job definition is shared across PRs and push-to-main. |
| .github/workflows/release.yml | Consolidates push-to-main verify/scan/deploy alongside the existing release job under one workflow. |
| .github/workflows/main.yml | Deletes the redundant push-to-main workflow to prevent duplicate CI runs. |
Review details
- Files reviewed: 5/5 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| # A superseded pull request run is waste. A superseded push to main is not: | ||
| # it is the run whose result the release and deploy jobs need. | ||
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} |
Problem
main.ymlandrelease.ymlboth triggered on push tomain, and each definedits own
verifyjob and its own caller ofuinaf/.githubscan.yml.Every push ran the entire gate twice. Check-runs on the previous main tip
1c690ea
show it:
verifytwice and each of the fourscan / *contexts twice, acrossrun 34638081028 and
run 34638081165 —
8 scan jobs, each a
fetch-depth: 0clone plus a Docker pull, and a duplicatedfull
vp run ready.Solution
The shape already proven in
uinaf/design:one push pipeline in
release.yml, the file npm Trusted Publishing binds to.verifyis nowuses: ./.github/workflows/verify.yml— the same definitionthat guards pull requests, so the push gate cannot drift from it.
verify.ymlgains
workflow_calland design'scancel-in-progress: ${{ github.event_name == 'pull_request' }}, because a superseded push run isthe one deploy and release need.
scanis declared once.deploymoved here frommain.ymland is a sibling ofrelease; both areon
needs: [verify, scan].main.ymlis deleted.permissions: contents: readexplicitly, sincerelease.ymlispermissions: {}wheremain.ymlgranted it workflow-wide.main.yml'sconcurrency: main-${{ github.repository }}came along.De-duplication, not a rewrite: the
releasejob is byte-identical to its previousform, and the
deployjob differs only by the two addedpermissionslines.Proof
deploynever waits onrelease: the two are siblings, bothneeds: [verify, scan], asserted by parsing the workflow rather than reading it.verify.yml(jobverify) andscan.yml(jobscan) onpull_request, and neither job was renamed. ThisPR's own checks are the live proof.
actionlintclean;zizmor1.29.0 (the version the shared scan pins) reportsno findings;
vp fmt --checkpasses.Before: 12 check-runs per push over 2 workflow runs. After: 7 over 1.