Skip to content
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

feat: add main branch to default release branch config #1737

Merged

Conversation

timfisher
Copy link
Contributor

@timfisher timfisher commented Jan 16, 2021

I had a confusing error message saying 1 to 3 branches were required when I had the following config:

module.exports = {
  release: { branches: 'main' },
  plugins: [
    '@semantic-release/commit-analyzer',
    '@semantic-release/release-notes-generator',
    ['@semantic-release/npm', { npmPublish: false }],
    '@semantic-release/github',
  ],
}

[semantic-release] » × ERELEASEBRANCHES The release branches are invalid in the branches configuration.
A minimum of 1 and a maximum of 3 release branches are required in the branches configuration (https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#branches).

This may occur if your repository does not have a release branch, such as master.

Although the config is incorrect adding main to the default config/ error message would help people in a similar situation who have missing config or incorrect config and a default main branch provided with github

@timfisher timfisher changed the title fix: add main branch to default release config fix: add main branch to default release branch config Jan 16, 2021
Copy link

@styfle styfle left a comment

Choose a reason for hiding this comment

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

Looks good to me 👍

@smilebot
Copy link

smilebot commented Jun 3, 2021

You might want to add main to the usage docs: And since it is the new Github default branch, looking into the future, it would make things a lot clearer if it were added to the README

@gr2m
Copy link
Member

gr2m commented Jun 3, 2021

You might want to add main to the usage docs: And since it is the new Github default branch, looking into the future, it would make things a lot clearer if it were added to the README

That's a good idea, PR welcome! I'd document it in the usage docs and then reference it from the README?

@otorrillas
Copy link
Contributor

You might want to add main to the usage docs: And since it is the new Github default branch, looking into the future, it would make things a lot clearer if it were added to the README

That's a good idea, PR welcome! I'd document it in the usage docs and then reference it from the README?

We've just opened one pull request to document it in @timfisher fork timfisher#1

@timfisher
Copy link
Contributor Author

I added @otorrillas docs looks like we need a maintainer to approve running the workflow now

@otorrillas
Copy link
Contributor

otorrillas commented Jun 14, 2021

@gr2m would you mind having a look now that it includes a docs update? 😄 thank you!

@nornagon
Copy link

Friendly ping :) would be great to get this merged!

@therussiankid92
Copy link
Contributor

@timfisher @styfle second friendly ping - with what can we contribute to make this change move forward?

@gr2m
Copy link
Member

gr2m commented Oct 5, 2021

I want us to finish the transition to ES Modules first: #2133. Once we have that, this issue is high on my priority. It will take a while to thoroughly test it.

@r4j4h
Copy link

r4j4h commented May 21, 2022

I think this might be preferable so as to support both:

  branches: [
    '+([0-9])?(.{+([0-9]),x}).x',
    '(master|main)',
    'next', 'next-major', {name: 'beta', prerelease: true}, {name: 'alpha', prerelease: true}
  ],

Note that master|main does not work, must have the parenthesis around it for semantic-release to treat as RegExp.

@nickmccurdy
Copy link

It seems like there's still more work to be done on the ES module conversion. Can we please get this merged in the interim? I'd argue it's already being sufficiently tested considering how many repositories are already using this configuration.

@Aeolun
Copy link

Aeolun commented Feb 5, 2024

@travi @gr2m Is this something that can maybe be merged? We've been dealing with this nonsense for literal years now. While I completely understand that you might have no time for a migration to ESM, it is incredibly frustrating that a package so central to my publishing workflow does not work with the default branch of my chosen VCS.

@gr2m
Copy link
Member

gr2m commented Feb 5, 2024

I hear you and agree. My life situation doesn't leave much time for semantic-release righ now, but this is my top priority as well. I'll talk to @travi about it this Friday, if anyone is interested in taking the lead on getting this feature shipped, please let us know. Really sorry about how long this takes, it frustrates me in my own usage of semantic-release as well.

@travi
Copy link
Member

travi commented May 3, 2024

so sorry that it has taken so long to get this moving forward. this is a change that is important to us, so i'm hoping we can get this merged soon. thanks a ton for all the work you put into this @timfisher, especially going beyond the functional change and tracking down the details throughout the docs to update along with it.

would you be willing to update this branch with the latest changes? i think this looks like it should get us to the point of getting it merged

@timfisher
Copy link
Contributor Author

so sorry that it has taken so long to get this moving forward. this is a change that is important to us, so i'm hoping we can get this merged soon. thanks a ton for all the work you put into this @timfisher, especially going beyond the functional change and tracking down the details throughout the docs to update along with it.

would you be willing to update this branch with the latest changes? i think this looks like it should get us to the point of getting it merged

Sure mate I will update this weekend 👍

@timfisher timfisher force-pushed the fix-add-main-to-default-release-config branch 4 times, most recently from 19d0069 to 44c92a2 Compare May 5, 2024 18:28
timfisher and others added 2 commits May 5, 2024 19:38
Co-authored-by: Andrei Danilov <andreialexandr.danilov@gmail.com>
@timfisher timfisher force-pushed the fix-add-main-to-default-release-config branch from 44c92a2 to 524a1b1 Compare May 5, 2024 18:38
@timfisher
Copy link
Contributor Author

@travi Should be good now 👍 Some CLI tests still reference master so I didn't know whether to duplicate them or not. I left them out. Thanks all.

@travi travi changed the base branch from master to beta May 8, 2024 03:20
@travi travi changed the title fix: add main branch to default release branch config feat: add main branch to default release branch config May 8, 2024
@travi travi merged commit 95d8736 into semantic-release:beta May 8, 2024
6 checks passed
Copy link

github-actions bot commented May 8, 2024

🎉 This PR is included in version 23.1.0-beta.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@travi
Copy link
Member

travi commented May 8, 2024

released to the beta channel to start with. would appreciate feedback from folks following this thread in case this introduces any surprises. hoping to promote to stable within a week or so, so feedback from folks that have tried it out would help with confidence for promoting.

@Aeolun
Copy link

Aeolun commented May 9, 2024

Awesome, I’m update my packages and see if anything breaks.

@gr2m
Copy link
Member

gr2m commented May 9, 2024

wohoo looks good when testing it locally! I'll test it in production as soon as the next opportunity arises. Thank you all for seeing this through ❤️

gr2m added a commit to octokit/auth-app.js that referenced this pull request May 9, 2024
@gr2m
Copy link
Member

gr2m commented May 9, 2024

First test in production: success

@timfisher timfisher deleted the fix-add-main-to-default-release-config branch May 9, 2024 21:10
@travi
Copy link
Member

travi commented May 10, 2024

PR to promote to stable: #3300

travi added a commit that referenced this pull request May 10, 2024
feat: add main branch to default release branch config (#1737)
Copy link

🎉 This PR is included in version 23.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet