Skip to content

gh aw trial --host-repo=. fails with "couldn't find remote ref main" when default branch is "master" #43347

Description

@m-titov

Running  gh aw trial  with  --host-repo=.  in a repository where the default branch is  master  instead of  main  fails immediately, making it impossible to test agentic workflows in such repositories at all.

Steps to reproduce

  1. Have a repository with  master  as the default branch
  2. Run:

gh aw trial ./dependency-cleanup.md --host-repo=.

Error

✗ failed to install workflow 'dependency-cleanup' in trial mode
  failed to commit and push workflow
  failed to pull latest changes: exit status 1 (output: fatal: couldn't find remote ref main
  )
  exit status 1

Expected behavior

gh aw trial  should respect the repository's actual default branch instead of hardcoding  main .

Actual behavior

The command unconditionally tries to pull from  main , fails, and aborts — no workflow is executed.

Impact

Any organization repository using  master  as the default branch cannot use  gh aw trial --host-repo=.  at all.
This is a complete blocker for local workflow testing.

Suggested fix / workaround

• Fix: detect the repository's default branch dynamically instead of hardcoding  main 
• Workaround: provide a  --branch  flag to let users specify the default branch manually

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions