Skip to content

Skip CI on draft PRs and cancel superseded PR runs in ci.yml - #11

Merged
Chase Hallahan (chasehallahan) merged 1 commit into
mainfrom
ci/draft-skip
Nov 11, 2026
Merged

Chase Hallahan (chasehallahan) merged 1 commit into
mainfrom
ci/draft-skip

Conversation

@chasehallahan

@chasehallahan Chase Hallahan (chasehallahan) commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

Applies the org CI rule from surmado/.github#204 to ci.yml: draft PRs skip every job, and a new push cancels the PR's in-flight run.

  • pull_request.types adds ready_for_review, so marking the PR ready starts the real run.
  • Every root job gets if: github.event.pull_request.draft != true. Jobs that need one skip with it.
  • concurrency keys on the PR number, and on run_id for any other event, so runs on main are never cancelled.
  • push triggers are unchanged.

Verified on this PR: opened as a draft, every job skipped; marked ready, the full run started.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@surmado-code-review-sandbox

surmado-code-review-sandbox Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Automated Checks (advisory, non-blocking)

✅ All checks passed.


Standards Compliance

Compliant with the org CI workflow rule: the workflow uses the required 2-space YAML formatting, retains the push trigger, adds ready_for_review, applies the draft guard to the root test job, and scopes concurrency by PR number while isolating non-PR runs by run_id.

The prior concern about omitting converted_to_draft does not apply under the current standard: it explicitly says to leave that event out so an already-running run is allowed to finish when a PR is converted back to draft.

Summary

This updates .github/workflows/ci.yml so draft PR runs skip CI, marking a PR ready starts a real run, and newer PR pushes cancel superseded runs. Pushes to main retain independent CI runs.
Reviewer: verify test is the workflow’s only root job; any additional root jobs would need the same draft guard.

What to pay attention to

  • Workflow lifecycle: The ready_for_review event and PR-number concurrency key are the important behavior changes; together they avoid billing draft work while ensuring ready PRs and latest commits are tested.

Things I noticed

No issues visible in this diff.

Good patterns

  • github.event.pull_request.number || github.run_id correctly prevents separate main push runs from sharing a concurrency group.
  • cancel-in-progress is limited to PR events, so new commits supersede only the prior run for that PR.

Surmado Code Review (v1.6-mt) — internal tenant (plan internal: metered, never gated).

This review: #3 on 387b6a5 · org docs ✓ 30.6K chars · README ✓ 10.4K chars · org-RAG 8 chunks · standards ✓ 45.4K chars · models gpt-5.6-terra (effort high) · $0.06 · PR total $0.19.

@chasehallahan

Copy link
Copy Markdown
Collaborator Author

🟡 converted_to_draft: declined. A run already going when a PR goes back to draft finishes, and the draft's next push cancels whatever is still running. Same types list as merged brand-web#807; surmado/.github#204 now states this reason in the canon.

@chasehallahan
Chase Hallahan (chasehallahan) marked this pull request as ready for review November 11, 2026 20:11
@chasehallahan

Copy link
Copy Markdown
Collaborator Author

/rerun-review

@chasehallahan
Chase Hallahan (chasehallahan) merged commit b371048 into main Nov 11, 2026
7 checks passed
@chasehallahan
Chase Hallahan (chasehallahan) deleted the ci/draft-skip branch November 11, 2026 22:21
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