Skip to content

Add --push and --create-pull-request flags to both add and init commands#11916

Merged
pelikhan merged 6 commits intomainfrom
copilot/enhance-gh-aw-commands
Jan 26, 2026
Merged

Add --push and --create-pull-request flags to both add and init commands#11916
pelikhan merged 6 commits intomainfrom
copilot/enhance-gh-aw-commands

Conversation

Copy link
Contributor

Copilot AI commented Jan 26, 2026

gh aw add had --create-pull-request but not --push. gh aw init had --push but not --create-pull-request. Both commands now support both flags.

Changes

gh aw add --push

  • Added --push flag that commits and pushes workflow changes after installation
  • Signature change: AddWorkflows() and addWorkflowsNormal() now accept push bool parameter
  • Reuses existing commitAndPushChanges(), checkOnDefaultBranch(), and confirmPushOperation() helpers
  • Commit message format: "chore: add workflow <name>" or "chore: add N workflows"

gh aw init --create-pull-request

  • Added --create-pull-request flag (with hidden --pr alias) that creates PR with initialization changes
  • Signature change: InitRepository() now accepts shouldCreatePR bool parameter (renamed to avoid conflict with createPR() function)
  • Creates temporary branch init-agentic-workflows-NNNN, commits, pushes, and creates PR
  • Requires GitHub CLI (gh) to be installed
  • Switches back to original branch after PR creation

Example Usage

# Add workflow and automatically push
gh aw add githubnext/agentics/ci-doctor --push

# Initialize and create PR
gh aw init --create-pull-request
Original prompt

This section details on the original issue you should resolve

<issue_title>The gh aw add has --create-pull-request, while gh aw init has --push. Both should support both flags.</issue_title>
<issue_description>gh aw add has --create-pull-request

gh aw init has --push

Both commands should support both flags.
</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits January 26, 2026 17:52
…init

Co-authored-by: dsyme <7204669+dsyme@users.noreply.github.com>
Co-authored-by: dsyme <7204669+dsyme@users.noreply.github.com>
Co-authored-by: dsyme <7204669+dsyme@users.noreply.github.com>
Co-authored-by: dsyme <7204669+dsyme@users.noreply.github.com>
Copilot AI changed the title [WIP] Add support for --create-pull-request and --push flags Add --push and --create-pull-request flags to both add and init commands Jan 26, 2026
Copilot AI requested a review from dsyme January 26, 2026 18:19
@pelikhan pelikhan marked this pull request as ready for review January 26, 2026 19:01
@pelikhan pelikhan merged commit cdcc005 into main Jan 26, 2026
50 checks passed
@pelikhan pelikhan deleted the copilot/enhance-gh-aw-commands branch January 26, 2026 19:11
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.

The gh aw add has --create-pull-request, while gh aw init has --push. Both should support both flags.

3 participants