Skip to content

ci: skip CI jobs on draft pull requests - #7345

Merged
thomhurst merged 1 commit into
mainfrom
ci/skip-draft-prs
Nov 1, 2026
Merged

thomhurst merged 1 commit into
mainfrom
ci/skip-draft-prs

Conversation

@thomhurst

Copy link
Copy Markdown
Owner

Summary

  • Every pull_request-triggered workflow (.NET, AOT, CodeQL Advanced, Locale Test, Platform smoke tests, CloudShop Example Tests, Agent Skill, Test Deploy to GitHub Pages, Documentation Link Check) now uses types: [opened, synchronize, reopened, ready_for_review].
  • Each root job gets if: github.event_name != 'pull_request' || !github.event.pull_request.draft. Draft PRs therefore run no CI jobs; marking a PR ready for review starts the full run.
  • push, schedule and workflow_dispatch triggers behave as before.
  • claude-code-review.yml is unchanged, so code reviews still run on drafts.

Notes

  • Skipped jobs report as skipped, which branch protection treats as passing. Draft PRs cannot merge anyway, and the ready_for_review run produces the real results.
  • Pushing to a draft still starts a (skipped) run in the concurrency group, which cancels any in-progress run from before the PR went back to draft.

Test plan

  • actionlint reports no new findings (only pre-existing custom runner-label warnings).
  • This PR: open as non-draft and confirm the jobs run.

PR-triggered workflows now list ready_for_review in their pull_request
types and guard each root job with a draft check, so draft PRs run no
CI until marked ready. Push, schedule and workflow_dispatch runs are
unchanged. Claude code review still runs on drafts.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-01T18:09:46.287352Z 04fab3b PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@thomhurst
thomhurst merged commit 7d0f0e2 into main Nov 1, 2026
9 of 30 checks passed
@thomhurst
thomhurst deleted the ci/skip-draft-prs branch November 1, 2026 18:09
@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Review

The change is consistent and does what the description says: each pull_request workflow gets types: [opened, synchronize, reopened, ready_for_review], and each root job gets a draft guard. push, schedule and workflow_dispatch runs are unaffected because the guard only applies when the event is pull_request. I read the diff and the job list in dotnet.yml; I did not run the workflows.

Things worth checking:

  1. Required checks. The PR notes that skipped jobs count as passing for branch protection. That holds for job-level if. It does not hold if a required check is a workflow that never starts, for example one filtered out by paths:. These workflows have no paths: change, so nothing new breaks here.
  2. Missing converted_to_draft. Converting a PR to draft does not trigger a run, so jobs already in progress keep running until the next push to the draft cancels them through the concurrency group. If you want them stopped immediately, add converted_to_draft to the types and let the guard skip the job. This is optional.
  3. Repeated condition. The same if: line is copied onto about 15 jobs. It works and is easy to read. If more workflows or jobs get added, a reusable workflow or a single gate job that the others needs: would keep it in one place. The cost is that it adds a dependency chain and changes the check names. I would leave it as is for now.
  4. Test plan. The last checkbox is still open. Opening this PR as non-draft and confirming the jobs run, then toggling it to draft and back, would cover both the skip path and the ready_for_review path.

Nothing blocking. Looks good to me.

🤖 Generated with Claude Code

@greptile-apps

greptile-apps Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

Nine workflows now skip jobs on draft pull requests and start checks when a PR becomes ready for review.

  • Pull-request checks wait until a draft is ready for review.

Acknowledged by thomhurst: skipped draft jobs count as passing checks, pushes to drafts cancel older runs, and claude-code-review.yml remains unchanged so reviews still run on drafts.

Reviews (1) · Last reviewed commit: "ci: skip CI jobs on draft pull requests" · Reviewed by Greptile

This branch was successfully deployed

No deployments
Pull Requests — 04fab3bd Deployed Nov 1, 2026 by thomhurst via modularpipeline (macos-latest) #20521
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant