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
add "main" as alternative default branch #1581
Comments
We discussed this topic internally, I run into this issue myself. We decided to hold on for now and wait to see if GitHub and the other big git hosting platforms agree on a new default branch name. I agree that it feels like it's going to be There are two things we could do to right now.
And there is no reason to start working on Neither @pvdlg nor I do have time to work on this right now, so we would appreciate a pull request if anyone wants to work on either of these |
I also raised this here: semantic-release/gitlab#152 |
Is there any progress on this? Seems the git platforms are inching closer to using This current configuration still gives the error |
No, but I hope to find some time in August. But if someone would like to
Agree. I think we would need to do something similar to what the GitHub Actions team did, and introduce a So we can configure the defaultBranch: "main",
branches: [
'+([0-9])?(.{+([0-9]),x}).x',
'$default-branch',
'next',
'next-major',
{name: 'beta', prerelease: true},
{name: 'alpha', prerelease: true},
], Or maybe there is a more elegant way, I couldn't look through the code base for this yet. And with current code base, we cannot support multiple default branches, so e.g. this would not work branches: [
'+([0-9])?(.{+([0-9]),x}).x',
'main',
'master',
'next',
'next-major',
{name: 'beta', prerelease: true},
{name: 'alpha', prerelease: true},
], At least not without significant changes. |
I did not have time to work on this. If anyone would like to look into implementing the |
just for the record, https://github.com/github/renaming states that
|
Hacktober fest is coming up! Would personally love to find some time and dive into this codebase with someone to get this moving. Does anyone know a bit about the reasoning behind the error? i.e which dependency is the root cause. Would be helpful so i could start reviewing the source code for both that and this library. |
With the error you mean "ERELEASEBRANCHES"? I didn't implement the multi-branch release feature, that was all @pvdlg. But I'm pretty sure that all the code is in the Maybe start out with a pull request containing a failing test, and we take the discussion there? |
Sorry for late reply, very busy semester. Will get on that right now @gr2m |
Is the workaround the following?
|
Yes |
Interesting, even though I have that setup https://github.com/americanexpress/iguazu-rest/blob/main/package.json#L97-L110 I still get
|
@JamesSingleton i got a similar error too, seems there are no quick fixes apart from developing a solid fix. Attempting to do so over on #1649, but it's taking some time. |
@DanielTamkin yeah not sure how @TimoBechtel got it working for his repos |
Me either. From my studying of the code base so far, I've found that Edit: @JamesSingleton discovered a solution by updating semantic-release to |
But "branches": [
"+([0-9])?(.{+([0-9]),x}).x",
"main",
"next",
"next-major",
{
"name": "beta",
"prerelease": true
},
{
"name": "alpha",
"prerelease": true
}
], Should override it though? |
It should, yes, I use that in several of my own repositories A simplified version where I only use the default branch: https://github.com/probot/pino/blob/cc8cc98b51dfd2d6e31140b7ac90ad07d8b6b122/package.json#L34-L38 I'm sure I use the full replacement in some repositories too, I'd need to look them up |
@gr2m so any idea on why GitHub actions is saying that |
That's interesting @gr2m! Tried that before and semantic-release still assumed master as default... would love to see those full replacements. Wonder if the version has something to do with it. |
@DanielTamkin I think it is. Our |
@DanielTamkin and @gr2m I just want to confirm that it was the version of |
This config is necessary since `semantic-release` doesn't detect the main branch for some reason. - Docs: [Configuration File](https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#configuration-file) - Related to semantic-release/semantic-release#1581
It implements a solution for the issue: semantic-release/semantic-release#1581
Until [this PR](semantic-release/semantic-release#1581) has been merged and released we need to ensure that repositories running on a main default branch instead of [one of these expected names](https://github.com/semantic-release/semantic-release/blob/master/lib/get-config.js#L57-L63) the release still works. This spire default can be overridden via the --branches flag
This seems to have gotten stale. GitHub now defaults all new repos to use |
semantic-release does not yet support `main` as a default branch name. see semantic-release/semantic-release#1581
We want to merge #1737 but were not able to sufficiently test it yet. It will take as much time as it takes, sorry, we do our best |
My current semantic-release version is 17.4.4. It is possible to complete the semantic version release, and the default branch main is valid. configure just like this: ....
branches:
[
"+([0-9])?(.{+([0-9]),x}).x",
"main",
"next",
"next-major",
{ name: "beta", prerelease: true },
{ name: "alpha", prerelease: true },
]
..... |
This config is necessary since `semantic-release` doesn't detect the main branch for some reason. - Docs: [Configuration File](https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#configuration-file) - Related to semantic-release/semantic-release#1581
This is not working for me. Getting the same branches error. |
Sorry, if I'm late to the party. But am I right that it's currently not possible to configure semantic-release to release from a branch called |
This issue is about adding |
Okay, and how do I configure it? Neither this:
nor this
works for me. |
Sorry, my bad. I had a wrong old origin in my package.json where It now works... Please forget what I said. |
New feature motivation
Lots of projects move from "master" as default branch to "main".
I, too, did change all default branches on GitHub to "main".
Changing this would have been a lot easier, if I wouldn't have to edit all the semantic-release configuration files.
Changing the config means, re-adding the default branches list, just to change the default branch to "main"
(correct me if there's a simpler solution).
New feature description
Add "main" to the list of branches in the default configuration.
The text was updated successfully, but these errors were encountered: