Skip to content

Add gh aw update --repo support with isolated shallow checkout and target-repo PR flow#32213

Merged
pelikhan merged 6 commits into
mainfrom
copilot/update-command-repo-support
May 14, 2026
Merged

Add gh aw update --repo support with isolated shallow checkout and target-repo PR flow#32213
pelikhan merged 6 commits into
mainfrom
copilot/update-command-repo-support

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 14, 2026

update previously operated only on the current repository. This change adds cross-repository targeting so updates can be applied to another repo via --repo, using an isolated checkout under .github/aw/updates, with optional PR creation in that target repo.

  • CLI surface

    • Adds --repo/-r to gh aw update.
    • Keeps --pr / --create-pull-request behavior, now supported in target-repo mode.
  • Target-repo execution model

    • For --repo owner/repo, performs a shallow clone (--depth=1) into:
      • .github/aw/updates/<sanitized-repo-id>
    • Runs the existing update pipeline from inside that checkout, so workflow updates, include resolution, lock updates, and compile behavior apply to the target repository context.
  • Ignored workspace for transient checkouts

    • Ensures .github/aw/updates/.gitignore exists and ignores all checkout contents while preserving the .gitignore file itself.
  • PR creation in target repo

    • In --repo mode with --pr, creates the PR from the cloned target repository (not the caller repo), using the existing PR helper flow.
  • Integration coverage

    • Extends update integration expectations to include --repo in command help and validates flag recognition path.
# Update workflows in a different repository
gh aw update --repo owner/repo

# Update + open PR in the target repository
gh aw update --repo owner/repo --pr

pr-sous-chef: attempted branch update (update_branch=true) from workflow run 25885271535

Generated by 👨‍🍳 PR Sous Chef ·


pr-sous-chef: automated branch update attempt — run: https://github.com/github/gh-aw/actions/runs/25886945106

Generated by 👨‍🍳 PR Sous Chef ·

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title Add gh aw update --repo support with shallow target checkout Add gh aw update --repo support with isolated shallow checkout and target-repo PR flow May 14, 2026
Copilot AI requested a review from pelikhan May 14, 2026 20:48
@pelikhan pelikhan marked this pull request as ready for review May 14, 2026 20:53
Copilot AI review requested due to automatic review settings May 14, 2026 20:53
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds gh aw update --repo support to run workflow updates against a target repository checkout and optionally create a PR there.

Changes:

  • Registers --repo/-r for update and documents it in help/examples.
  • Adds target-repo update flow using a shallow gh repo clone under .github/aw/updates.
  • Adds integration assertions for help text and flag recognition.
Show a summary per file
File Description
pkg/cli/update_command.go Adds target repository checkout/update/PR flow and checkout gitignore handling.
pkg/cli/update_integration_test.go Extends update command integration coverage for --repo.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 2/2 changed files
  • Comments generated: 2

Comment thread pkg/cli/update_command.go
Comment on lines +206 to +207
checkoutDir := filepath.Join(updatesDir, sanitizeRepoPath(targetRepo))
if err := shallowCloneTargetRepo(ctx, targetRepo, checkoutDir); err != nil {
assert.Contains(t, outputStr, "no-merge", "Help should document --no-merge flag")
assert.Contains(t, outputStr, "no-redirect", "Help should document --no-redirect flag")
assert.Contains(t, outputStr, "disable-security-scanner", "Help should document --disable-security-scanner flag")
assert.Contains(t, outputStr, "repo", "Help should document --repo flag")
@github-actions
Copy link
Copy Markdown
Contributor

@copilot review all comments — please address any unresolved review feedback. Once addressed, push fixup commits and request re-review, or post a short completion plan summarizing remaining blockers. (pr-sous-chef run: 25885271535)

Generated by 👨‍🍳 PR Sous Chef ·

@pelikhan
Copy link
Copy Markdown
Collaborator

@copilot add ci integration test job that run gh aw update --repo for githubnext/agentic-ops

Copilot AI and others added 2 commits May 14, 2026 21:59
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 14, 2026

@copilot add ci integration test job that run gh aw update --repo for githubnext/agentic-ops

Added in f8c8a6d.

ci.yml now includes a new integration-update-target-repo job that builds gh-aw and runs:
gh-aw update --repo githubnext/agentic-ops --no-compile --verbose

@github-actions
Copy link
Copy Markdown
Contributor

@copilot review all comments
Please address unresolved review feedback and summarize remaining blockers.

pr-sous-chef run: https://github.com/github/gh-aw/actions/runs/25889685241

Generated by 👨‍🍳 PR Sous Chef ·

@pelikhan
Copy link
Copy Markdown
Collaborator

@copilot merge main and recompile

…d-repo-support

# Conflicts:
#	.github/workflows/daily-cache-strategy-analyzer.lock.yml
#	.github/workflows/daily-fact.lock.yml
#	.github/workflows/daily-observability-report.lock.yml
#	.github/workflows/duplicate-code-detector.lock.yml
#	.github/workflows/grumpy-reviewer.lock.yml
#	.github/workflows/issue-arborist.lock.yml
#	.github/workflows/necromancer.lock.yml
#	.github/workflows/pr-sous-chef.lock.yml
#	.github/workflows/schema-feature-coverage.lock.yml
#	.github/workflows/smoke-call-workflow.lock.yml
#	.github/workflows/smoke-codex.lock.yml

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
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.

3 participants