actions
actions copied to clipboard
Move `master` branch to `main`
The master
branch of this repository will soon be renamed to main
, as part of a coordinated change across several GitHub organizations (including, but not limited to: tidyverse, r-lib, tidymodels, and sol-eng). We anticipate this will happen by the end of September 2021.
That will be preceded by a release of the usethis package, which will gain some functionality around detecting and adapting to a renamed default branch. There will also be a blog post at the time of this master
--> main
change.
The purpose of this issue is to:
- Help us firm up the list of targetted repositories
- Make sure all maintainers are aware of what's coming
- Give us an issue to close when the job is done
- Give us a place to put advice for collaborators re: how to adapt
message id: euphoric_snowdog
I think this is a bad idea for this particular repo, because people almost everywhere have this in their workflow:
https://github.com/r-lib/actions/blob/55aea734d73636a0617990c2899c8f86ef8a9877/.github/workflows/check-full.yaml#L43
Because the yml assumes the action lives in @master
this will break all those workflows.
That's workflow config for this repo itself (which presumably should be updated).
But the examples we encourage other people to use (and that usethis grabs) use other tags, e.g., v1
:
https://github.com/r-lib/actions/blob/55aea734d73636a0617990c2899c8f86ef8a9877/examples/check-full.yaml#L48
This has been true for "a while".
So, I think if someone notices that the branch renaming breaks their GHA, it might have a healthy effect of nudging them to update their workflows.
OK, I did not know that @v1
was the recommended branch. A quick GH search shows about half of the workflows use @master
... perhaps we can leave the master branch around for a bit longer for backward compat (just a copy of main).
Even if workflows do use master GitHub sets up automatic redirection when you rename the branch via their API.
When you rename a branch on GitHub, any URLs that contain the old branch name are automatically redirected to the equivalent URL for the renamed branch.
https://docs.github.com/en/github/administering-a-repository/managing-branches-in-your-repository/renaming-a-branch
Though potentially this could still impact the actions here as raw git pull
requests are not affected
Although file URLs are automatically redirected, raw file URLs are not redirected. Also, GitHub does not perform any redirects if users perform a git pull for the previous branch name.
So maybe we would have to do this (I should really read the whole article before commenting 😁)
GitHub Actions workflows do not follow renames, so if your repository publishes an action, anyone using that action with @{old-branch-name} will break. You should consider adding a new branch with the original content plus an additional commit reporting that the branch name is deprecated and suggesting that users migrate to the new branch name.
But anyway I agree with @jeroen that we need to be more careful when renaming this repo vs others.
I have an exclusion list to omit specific repos that are otherwise covered by my "whole org" approach (of which r-lib is one).
Should I put r-lib/actions
on the exclusion list? That's what I'm hearing.
yes, we will need to be careful in how we change this one, likely adding a deprecation message to actions used from 'master' after the switch happens.
OK, r-lib/actions
is now excluded from my current bulk renaming effort re: default branch. I'll leave this issue open, since it sounds like the switch will eventually happen, but in a more customized way, on a different schedule.
Maybe for this repo the default branch should be v1
instead of main
such that we don't need to keep moving the tag for every bug fix. Many other action repos use e.g. v1
and v2
for their moving branches, and for tags (if any) they use v1.2.3
I'm about to do the master
--> main
push in bulk now and have just reminded myself to exclude this one. Correct me if I'm wrong.
Whenever this gets dealt with, we also need to think about this bit at the top of all example workflows:
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
Should master
be replaced with main
, HEAD
, v1
?
We can keep master around for a while and make the soon to be official v2
branch the default.
For the record, this is mostly done in v2
. The next steps will be to document v2
and how the tags work in general in the main README, and then making v2
the default branch. This will happen once we tested v2
a bit.
I was updating a broken GHA workflows and reflexively specified r-lib/actions/setup-r@main
, assuming main is the new master. I saw:
Error: Unable to resolve action `r-lib/actions@main`, unable to find version `main`
Of course I should have checked first. I only comment to say that, since the expectation is now for main
to be the default, I expect many more will encounter this same issue.
Do not use master
or main
, the former is arbitrary, and will be obsolete, the latter will probably never exist. Use v1
for the "current" actions, or v2
for the one coming soon: https://github.com/r-lib/actions/releases/tag/v2
FYI usethis will gain some awareness of these version issues: https://github.com/r-lib/usethis/issues/1541
Now the v2-branch
is the default. master
is still around, and will be around for a while.
At some point I'll add a warning to the actions that use @master
, to point them to using @v2
, and then a couple of months later delete master
.
We can keep this issue around until all this is done.
I just renamed master
to old
, I am pretty sure that it is mostly defunct now, anyway.
wondering why all my cron actions suddenly broke.
For anyone who stumbles on this after googling Error: Unable to resolve action r-lib/actions@master
change it to @v2
and you should be back in action.
I am sorry for the inconvenience. @master
was never meant for public use, actually, and many @v2
actions are much better than @master
, which is still available under the name @old
, so hopefully the switch will improve your workflows.
This issue has been automatically locked. If you believe you have found a related problem, please file a new issue and include a link to this issue