-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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 renamed default branches #210
Comments
I wonder whether the default branch can be determined from the github event payload. Would enable implementing without making an extra call to the rest api. |
It looks like the default branch can be retrieved from the event payload on disk: - run: |
node -p "require(process.env.GITHUB_EVENT_PATH).repository.default_branch" However that would only work for the workflow repo. For other repositories, would need to either query REST API or fallback to master |
An example is drupal/drupal which doesn't have a master branch at all which leads to this error:
So from my point of view this is rather a bug than an enhancement ;-) |
I played with the REST API a little bit. The default branch can be retrieved from the REST API. I'm in favor of doing this feature, just havent gotten to it yet. |
A lot of people renaming their master branches lately... Haven't looked at this code, but maybe I'll take a look this weekend at making a PR unless you're close to picking this up. |
looking into this now |
PR #278 (testing now) |
the
ref:
input parameter seems to be hardcoded falling back tomaster
.https://github.com/actions/checkout/blob/master/README.md#L43-L46
since github support renaming the default branch, IMO the actions/checkout action should take this into account and therefore use the 'default-branch' as a fallback instead of always
master
The text was updated successfully, but these errors were encountered: