Skip to content

Document and validate draft: true default for create-pull-request#11337

Closed
Copilot wants to merge 2 commits intomainfrom
copilot/set-draft-pull-request-default
Closed

Document and validate draft: true default for create-pull-request#11337
Copilot wants to merge 2 commits intomainfrom
copilot/set-draft-pull-request-default

Conversation

Copy link
Contributor

Copilot AI commented Jan 22, 2026

Agentic workflows should create draft PRs by default as a security best practice, preventing accidental auto-merge of AI-generated code. The default was already draft: true, but this was implicit and undocumented.

Changes

  • Documentation: Updated struct field and code comments to clarify draft: true is the default and explain security rationale
  • Validation: Added debug log warning when draft: false is explicitly set (informational only, non-blocking)
  • JavaScript: Enhanced comments in create_pull_request.cjs handler to document the default behavior

Example

safe-outputs:
  create-pull-request:
    title-prefix: "[ai] "
    labels: [automation]
    # draft: true is the default - omit or set explicitly
    # Use draft: false only for auto-merge workflows

When compiling workflows with draft: false, debug output now includes:

WARNING: draft: false is explicitly set - agentic workflows should create draft PRs by default

No breaking changes - workflows with explicit draft: false continue to work for intentional auto-merge scenarios.

Original prompt

All agentic workflows using create-pull-request should use draft: true or omit it is the default


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Update agentic workflows for draft pull requests Document and validate draft: true default for create-pull-request Jan 22, 2026
@pelikhan pelikhan closed this Jan 22, 2026
Copilot AI requested a review from pelikhan January 22, 2026 15:50
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.

2 participants