Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

* [PR-19](https://github.com/itk-dev/gh-itkdev/pull/19)
Always use release/{version} branch naming convention
* [PR-16](https://github.com/itk-dev/gh-itkdev/pull/16)
Added version check to determine release type
* [PR-15](https://github.com/itk-dev/gh-itkdev/pull/15)
Expand Down
12 changes: 3 additions & 9 deletions changelog/release.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,9 @@ func getBranchName(release string) (string, error) {
return "", fmt.Errorf("invalid version: %s", release)
}

branchType := "release"
// Determine if the release is a "release" or a "hotfix".
//
// A "hotfix" is a version that's not a prerelease and has a patch version different from 0 (cf. https://semver.org/).
if semver.Prerelease(version) == "" && semver.MajorMinor(version)+".0" != version {
branchType = "hotfix"
}

return branchType + "/" + release, nil
// Our default Woodpecker setup only triggers on release/* branches,
// so always use that naming scheme, regardless of the nature of the change.
return "release/" + release, nil
}

func createReleaseBranch(release string, base string) (string, error) {
Expand Down
2 changes: 1 addition & 1 deletion changelog/release_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func TestBranchName(t *testing.T) {
},
{
"v0.0.1",
"hotfix/v0.0.1",
"release/v0.0.1",
"",
},
{
Expand Down
Loading