atc0005 / shared-project-resources

Shared workflows and tooling for projects that I maintain
MIT License
1 stars 0 forks source link

Automatic releases for prerelease tags using incorrect previous tag to generate release notes #188

Closed atc0005 closed 7 months ago

atc0005 commented 7 months ago

Until just recently, generating GitHub releases using the gh CLI tool worked without apparent issue, creating valid release notes whether for stable releases tied to the master branch or non-stable releases from the development branch.

With recent work in the safelinks project I noticed that the previous stable tag was used as a comparison even though the release was being generated using a non-stable tag from a different branch. This results in a long list of recent changes which did not apply to the tag.

When I manually edited the release and explicitly chose the previous non-stable tag (e.g., v0.5.0-alpha.2 vs v0.5.0-alpha.3) the release notes were generated properly.

atc0005 commented 7 months ago

As a workaround, I'm going to update the handling of non-stable tags (alpha, beta) to generate the release notes beforehand and use those when generating the release. That generation will include explicitly calculating the previous tag and using that as a reference point for comparison.

atc0005 commented 7 months ago

I think this is fixed now.

atc0005 commented 7 months ago

Generated some additional test stable/dev releases and so far everything is working again.

Will keep an eye on the https://github.com/cli/cli project to see if anyone else reports issues generating automatic release notes for pre-release tags (where the previous pre-release tag is inferred).

Worst case the updated logic provides a useful foundation for further customization in the future.