New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support both main and master as default branches #974
Comments
We might not need to make any changes here. Recently GitHub made an update so links to branches that don't exist redirect to the default branch. Revisiting the changes in #943, removing the |
The redirect from deleted to main branch thing doesn't solve things for new repos which never had a Also some repos use custom default branches, I'd suggest that OctoLinker should actually lookup what the default branch is for a repo, and use that. |
I agree that looking up what the actual default branch for a repo is would be the ideal solution. However, I'm less sure how to implement this given this requires an API call that needs to be resolved before anything else. Also, for users without a token it could eat up the rate limit quickly. I think we should do a best effort here given that either |
Ah, true, requiring an API for that would be annoying. Maybe it could be somewhat cleaver and look it up if an API key is available, otherwise try |
There is a trick to get the default branch without any guessing involved: Specify https://github.com/facebook/jest/tree/master/packages/jest-environment-jsdom But this doesn't: https://github.com/facebook/jest/tree/HEAD/packages/jest-environment-jsdom |
Recently GitHub announced they were going to be renaming their default branches to
main
and that this should become the default for new repos too. Other repos have already made the switch.There's a few spots where the code assumes
master
as the default.OctoLinker/packages/plugin-go/index.js
Lines 20 to 35 in 9e606a9
OctoLinker/packages/plugin-homebrew-manifest/index.js
Lines 10 to 13 in 9e606a9
The remaining spots all look to be related to tests.
The GitHub Actions plugin is already handling this but might need to be changed depending on how this is handled going forward.
OctoLinker/packages/plugin-github-actions/index.js
Lines 21 to 24 in 9e606a9
The text was updated successfully, but these errors were encountered: