go-semantic-release / semantic-release

📦🚀 semantic-release written in Go
https://go-semantic-release.xyz
MIT License
395 stars 43 forks source link

Generating a release on a non default branch GitHub #156

Open tim0git opened 1 year ago

tim0git commented 1 year ago

Hi folks how do i configure the package to generate a release on main when we have set the default branch to be dev?

The commit analyser is reading the default branch. And i would like to to read the main branch.

cliedeman commented 1 year ago

Hi @tim0git

What error are you getting?

The default branch should come directly from the provider

https://github.com/go-semantic-release/provider-github/blob/master/pkg/provider/github.go#L82

tim0git commented 1 year ago

Yup. Its finds the default branch correctly. And Analyzes dev. However we are triggering the ci workflow on main. And would like to analyze the commits from the main branch without changing the GitHub default branch from dev to main.

tim0git commented 1 year ago

So it does not Error. However it does not find any changes.

cliedeman commented 1 year ago

Thanks for clarifying.

This isn't currently supported (@christophwitzko can double check) We will need to add a config option to override the default branch.

https://github.com/go-semantic-release/semantic-release/blob/9c07709a89936b04cdfa6e07f310331d09b24336/cmd/semantic-release/main.go#L191

Ciaran

christophwitzko commented 11 months ago

Thanks @cliedeman, you are right. I will leave this issue open for now, until we add support for it.