Skip to content

Conversation

@mcafaro
Copy link
Member

@mcafaro mcafaro commented Sep 23, 2025

This pull request adds default branch detection to the workflow generator to address issue #18.

To detect the default branch, the generator first attempts to call the GitHub API. However, because it does not have a token and runs in the user's browser, it is very possible for it to be rate limited. Therefore, it falls back to a heuristic of looking for a README.md on a few common branch names. If that fails to work, it falls back to using "main" as it does today.

@mcafaro mcafaro changed the title Try to detect default branch Detect default branch Sep 23, 2025
@mcafaro mcafaro marked this pull request as ready for review September 23, 2025 21:20
Copy link

@davidbuzinski davidbuzinski left a comment

Choose a reason for hiding this comment

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

This seems reasonable. I wonder about if the GitHub API calls will work from the browser, but the fallback makes sense

@mcafaro mcafaro merged commit 13d60c3 into main Sep 24, 2025
1 check passed
@mcafaro mcafaro deleted the branch-detection branch September 24, 2025 19:07
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