Skip to content

Use GitHub default_branch in pod spec create instead of hardcoded 'master'#1

Draft
Copilot wants to merge 2 commits intomasterfrom
copilot/main
Draft

Use GitHub default_branch in pod spec create instead of hardcoded 'master'#1
Copilot wants to merge 2 commits intomasterfrom
copilot/main

Conversation

Copy link

Copilot AI commented Mar 22, 2026

pod spec create was hardcoded to fall back to 'master' when looking up the default branch of a GitHub repo, causing failures for repos using 'main' (or any other non-master default branch).

Changes

  • suggested_ref_and_version: Branch resolution now follows: repo['default_branch'] (current GitHub API field) → repo['master_branch'] (deprecated field) → 'main' (fallback)
  • Renamed local variable masterdefault_branch_data to reflect it may not be master
  • Updated error message: "master branch""default branch"
# Before
master_name = repo['master_branch'] || 'master'
master      = branches.find { |branch| branch['name'] == master_name }
raise Informative, "Unable to find any commits on the master branch ..."

# After
default_name        = repo['default_branch'] || repo['master_branch'] || 'main'
default_branch_data = branches.find { |branch| branch['name'] == default_name }
raise Informative, "Unable to find any commits on the default branch ..."
Original prompt

Main


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Update main branch with latest changes Use GitHub default_branch in pod spec create instead of hardcoded 'master' Mar 22, 2026
Copilot AI requested a review from Aksel1984 March 22, 2026 18:06
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