Skip to content

Remove --create-pull-request and --push flags from add command#19016

Draft
Copilot wants to merge 4 commits intomainfrom
copilot/remove-pr-creation-behavior
Draft

Remove --create-pull-request and --push flags from add command#19016
Copilot wants to merge 4 commits intomainfrom
copilot/remove-pr-creation-behavior

Conversation

Copy link
Contributor

Copilot AI commented Mar 1, 2026

The add command was conflating workflow installation with git operations and PR creation, which diverges from standard package manager behavior (e.g., npm install, go get). Git operations and PR creation are the add-wizard's responsibility.

Changes

  • add_command.go: Removed --create-pull-request / --pr flags and --push flag, their RunE reading code, and corresponding opts assignments. Removed !prFlag gate from the useInteractive condition. Cleaned up Long description examples and flag notes. Removed CreatePR and Push from AddOptions; removed PRNumber/PRURL from AddWorkflowsResult. Removed the commitAndPush block from addWorkflowsWithTracking.
  • add_workflow_pr.go: Added AddWizardResult type (holds PRNumber, PRURL, HasWorkflowDispatch) and AddResolvedWorkflowsWithPR function that encapsulates PR prerequisite checks, branch creation, commit, push, and PR creation for the wizard.
  • add_interactive_git.go: Updated to call AddResolvedWorkflowsWithPR directly instead of passing CreatePR: true or Push: true through AddOptions.
  • add_interactive_orchestrator.go: Updated to store *AddWizardResult instead of *AddWorkflowsResult.
  • add_command_test.go: Removed assertions for deleted flags and PR fields; simplified TestAddWorkflowsResult.
  • add_workflow_pr_test.go: Added TestAddWizardResult to cover the new wizard result type.
Original prompt

Remove PR creation behavior in "add" command. The add-wizard does this kind of operation.

The "add" command should behave like other package add command so that engineer are familiar with its behavior.


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Remove PR creation behavior from add command Remove --create-pull-request flag from add command Mar 1, 2026
@pelikhan
Copy link
Contributor

pelikhan commented Mar 1, 2026

@copilot split the interface types for add wizard and finish the cleanup

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 1, 2026

@copilot split the interface types for add wizard and finish the cleanup

Done in b7921d3. Split the types as follows:

  • AddOptions.CreatePR removed — wizard-only concern
  • AddWorkflowsResult.PRNumber/PRURL removed — wizard-only concern
  • New AddWizardResult type in add_workflow_pr.go holds PRNumber, PRURL, HasWorkflowDispatch
  • New AddResolvedWorkflowsWithPR function in add_workflow_pr.go encapsulates PR prerequisite checks + PR creation for the wizard
  • add_interactive_git.go calls AddResolvedWorkflowsWithPR directly; add_interactive_orchestrator.go stores *AddWizardResult

@pelikhan
Copy link
Contributor

pelikhan commented Mar 1, 2026

@copilot render the help of add and add-wizard

@pelikhan
Copy link
Contributor

pelikhan commented Mar 1, 2026

@copilot remove the --push option of add command. The add command should not interact with git. Only the add-wizard does git operations.

Copy link
Contributor Author

Copilot AI commented Mar 1, 2026

@copilot render the help of add and add-wizard

Both add and add-wizard are aliases of the same command, so their help output is identical. Here it is:

Add one or more workflows from repositories to .github/workflows.

By default, this command runs in interactive mode, which guides you through:
  - Selecting an AI engine (Copilot, Claude, or Codex)
  - Configuring API keys and secrets
  - Creating a pull request with the workflow
  - Optionally running the workflow

Use --non-interactive to skip the guided setup and add workflows directly.

Examples:
  gh aw add githubnext/agentics/daily-repo-status        # Interactive setup (recommended)
  gh aw add githubnext/agentics/ci-doctor --non-interactive  # Skip interactive mode
  gh aw add githubnext/agentics/ci-doctor@v1.0.0         # Add with version
  gh aw add githubnext/agentics/workflows/ci-doctor.md@main
  gh aw add https://github.com/githubnext/agentics/blob/main/workflows/ci-doctor.md
  gh aw add githubnext/agentics/ci-doctor --push         # Add and push changes
  gh aw add ./my-workflow.md                             # Add local workflow
  gh aw add ./*.md                                       # Add all local workflows
  gh aw add githubnext/agentics/ci-doctor --dir shared   # Add to .github/workflows/shared/

...

Usage:
  gh aw add <workflow>... [flags]

Aliases:
  add, add-wizard

Flags:
      --append string              Append extra content to the end of agentic workflow on installation
  -d, --dir string                 Subdirectory under .github/workflows/ (e.g., 'shared' creates .github/workflows/shared/)
      --disable-security-scanner   Disable security scanning of workflow markdown content
  -e, --engine string              Override AI engine (claude, codex, copilot, custom)
  -f, --force                      Overwrite existing workflow files without confirmation
  -h, --help                       help for add
  -n, --name string                Specify name for the added workflow (without .md extension)
      --no-gitattributes           Skip updating .gitattributes file
      --no-stop-after              Remove any stop-after field from the workflow
      --non-interactive            Skip interactive setup and use traditional behavior (for CI/automation)
      --push                       Automatically commit and push changes after successful workflow addition
  -r, --repo string                Source repository containing workflows (owner/repo format)
      --stop-after string          Override stop-after value in the workflow (e.g., '+48h', '2025-12-31 23:59:59')

Global Flags:
      --banner    Display ASCII logo banner with purple GitHub color theme
  -v, --verbose   Enable verbose output showing detailed information

--create-pull-request / --pr are gone from the flags list. PR creation remains part of the interactive wizard flow only.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 1, 2026

@copilot remove the --push option of add command. The add command should not interact with git. Only the add-wizard does git operations.

Done in 57f9a23. Removed --push from the add command entirely — Push bool dropped from AddOptions, flag registration removed, and the commitAndPush block deleted from addWorkflowsWithTracking. Git operations remain exclusively in the add-wizard path.

Updated help:

Flags:
      --append string              Append extra content to the end of agentic workflow on installation
  -d, --dir string                 ...
      --disable-security-scanner   ...
  -e, --engine string              ...
  -f, --force                      ...
  -h, --help                       ...
  -n, --name string                ...
      --no-gitattributes           ...
      --no-stop-after              ...
      --non-interactive            ...
  -r, --repo string                ...
      --stop-after string          ...

--push is no longer listed.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/graphql
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw GO111MODULE 64/bin/go /tmp/go-build772/tmp/gh-aw/aw-feature-branch.patch -tes�� -test.paniconexit0 -test.v=true /usr/bin/git -test.timeout=10git -test.run=^Test -test.short=true--show-toplevel git (http block)
  • https://api.github.com/repos/actions/ai-inference/git/ref/tags/v1
    • Triggering command: /usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v1 --jq .object.sha GOMODCACHE go ache/node/24.13.1/x64/bin/node -json GO111MODULE 64/bin/go ache/node/24.13.1/x64/bin/node 1921�� y -importcfg /usr/bin/git -s -w -buildmode=exe git (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v3
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v3 --jq .object.sha SameOutput1753691547/001/stability-test.md GO111MODULE /opt/hostedtoolcache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 540808/b419/styles.test GOINSECURE GOMOD GOMODCACHE 540808/b419/styles.test (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v5
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha -unreachable=false /tmp/go-build772540808/b108/vet.cfg /usr/bin/git prettier --check 64/bin/go git rev-�� --show-toplevel sh /opt/hostedtoolcache/node/24.13.1/x64/bin/node &#34;prettier&#34; --chegit sh 64/bin/go node (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha --show-toplevel go /usr/bin/git 350897061 GO111MODULE 64/bin/go git rev-�� --show-toplevel go /usr/bin/git -json GO111MODULE til.test git (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v6
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha runs/20260301-120955-28350/test-1856630369 -trimpath /usr/bin/git -p main -lang=go1.25 git rev-�� --show-toplevel -dwarf=false ache/node/24.13.1/x64/bin/node go1.25.0 -c=4 -nolocalimports infocmp (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha bility_SameInputSameOutput1753691547/001/stability-test.md -trimpath /usr/bin/infocmp -p main -lang=go1.25 infocmp -1 xterm-color -dwarf=false /usr/bin/gh go1.25.0 -c=4 -nolocalimports gh (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha --show-toplevel go /usr/bin/git -json GO111MODULE 64/bin/go git rev-�� --show-toplevel go /usr/bin/git -json GO111MODULE 64/bin/go git (http block)
  • https://api.github.com/repos/actions/github-script/git/ref/tags/v8
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha GOSUMDB GOWORK 64/bin/go GOINSECURE GOMOD GOMODCACHE go env ck &#39;scripts/**/*GOINSECURE GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha go1.25.0 -c=4 -nolocalimports -importcfg /tmp/go-build772540808/b386/importcfg -pack /tmp/go-build772540808/b386/_testmain.go env 5588887/b394/_pkGOINSECURE GO111MODULE 64/bin/go GOINSECURE b/gh-aw/pkg/logg-o GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha go1.25.0 -c=4 -nolocalimports -importcfg /tmp/go-build772540808/b392/importcfg -pack /tmp/go-build772540808/b392/_testmain.go env 5588887/b411/_pkGOINSECURE GO111MODULE 64/bin/go GOINSECURE b/gh-aw/pkg/time-atomic GOMODCACHE /bin/sh (http block)
  • https://api.github.com/repos/actions/setup-go/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq .object.sha -bool -buildtags /usr/bin/git -errorsas -ifaceassert -nilfunc git rev-�� --show-toplevel (http block)
  • https://api.github.com/repos/actions/setup-node/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq .object.sha s/test.md --json /usr/bin/git GOSUMDB GOWORK 64/bin/go git -C /home/REDACTED/work/gh-aw/gh-aw/.github/workflows rev-parse /opt/hostedtoolcache/node/24.13.1/x64/bin/node ck &#39;scripts/**/*git GO111MODULE 64/bin/go node (http block)
  • https://api.github.com/repos/actions/upload-artifact/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v4 --jq .object.sha -json GO111MODULE ache/go/1.25.0/x64/pkg/tool/linux_amd64/compile GOINSECURE GOMOD GOMODCACHE ache/go/1.25.0/x64/pkg/tool/linux_amd64/compile env 540808/b399/_pkg_.a GO111MODULE 540808/b399=&gt; GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/1/artifacts
    • Triggering command: /usr/bin/gh gh run download 1 --dir test-logs/run-1 GO111MODULE x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/12345/artifacts
    • Triggering command: /usr/bin/gh gh run download 12345 --dir test-logs/run-12345 GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/12346/artifacts
    • Triggering command: /usr/bin/gh gh run download 12346 --dir test-logs/run-12346 GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/2/artifacts
    • Triggering command: /usr/bin/gh gh run download 2 --dir test-logs/run-2 GO111MODULE x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/3/artifacts
    • Triggering command: /usr/bin/gh gh run download 3 --dir test-logs/run-3 GO111MODULE x_amd64/link GOINSECURE GOMOD GOMODCACHE x_amd64/link env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE wE/WqLtr-OMj2UJecdoY4J0/osnbqV-Hv_T9I4Q6GR2m (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/4/artifacts
    • Triggering command: /usr/bin/gh gh run download 4 --dir test-logs/run-4 GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go stlo�� -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/5/artifacts
    • Triggering command: /usr/bin/gh gh run download 5 --dir test-logs/run-5 GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go stlo�� -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/github/gh-aw/actions/workflows
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path GOSUMDB GOWORK 64/bin/go GOINSECURE GOMOD GOMODCACHE go env ck &#39;scripts/**/*GOINSECURE GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh run list --json databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --workflow nonexistent-workflow-12345 --limit 100 GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE sh (http block)
    • Triggering command: /usr/bin/gh gh run list --json databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --workflow nonexistent-workflow-12345 --limit 6 GOMOD GOMODCACHE x_amd64/compile env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v1.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq .object.sha -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/nonexistent/action/git/ref/tags/v999.999.999
    • Triggering command: /usr/bin/gh gh api /repos/nonexistent/action/git/ref/tags/v999.999.999 --jq .object.sha -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env 1832887582/.github/workflows GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/nonexistent/repo/actions/runs/12345
    • Triggering command: /usr/bin/gh gh run view 12345 --repo nonexistent/repo --json status,conclusion GOINSECURE GOMOD GOMODCACHE x_amd64/vet env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/owner/repo/actions/workflows
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path --repo owner/repo 64/bin/go GOINSECURE GOMOD GOMODCACHE go m/_n�� -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/owner/repo/contents/file.md
    • Triggering command: /tmp/go-build772540808/b380/cli.test /tmp/go-build772540808/b380/cli.test -test.testlogfile=/tmp/go-build772540808/b380/testlog.txt -test.paniconexit0 -test.v=true -test.parallel=4 -test.timeout=10m0s -test.run=^Test -test.short=true GOINSECURE GOMOD GOMODCACHE ortcfg env g/workflow/featuGOINSECURE g/workflow/imporGOMOD 64/bin/go GOINSECURE GOMOD GOMODCACHE ache/go/1.25.0/xGO111MODULE (http block)
  • https://api.github.com/repos/test-owner/test-repo/actions/secrets
    • Triggering command: /usr/bin/gh gh api /repos/test-owner/test-repo/actions/secrets --jq .secrets[].name GOSUMDB GOWORK 64/bin/go GOINSECURE GOMOD GOMODCACHE erignore env ck &#39;scripts/**/*GOINSECURE GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/test-owner/test-repo/actions/secrets --jq .secrets[].name --show-toplevel git 64/bin/go tags/v3 go /usr/bin/git git rev-�� --show-toplevel git 64/bin/go --show-toplevel go /usr/bin/git git (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title Remove --create-pull-request flag from add command Remove --create-pull-request and --push flags from add command Mar 1, 2026
@github-actions github-actions bot mentioned this pull request Mar 1, 2026
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