go-semantic-release / semantic-release

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

Release doesn't recognize latest commits #154

Closed tcpaddock closed 1 year ago

tcpaddock commented 1 year ago

Hi, I'm having trouble producing consistent releases. I've tried merge PRs and squash PRs. In both cases, the GitHub action job logs the latest commit correctly but it fails to calculate a change. My current workaround is to delete the latest release and rerun job. This picks up the commits from the deleted release and the missing commits. At some point, this won't be an option.

For example, this run is expected to create release version 1.0.0-alpha.5.

[go-semantic-release]: version: 2.27.1
[go-semantic-release]: trying to prefetch plugins...
[go-semantic-release]: all plugins were prefetched!
[go-semantic-release]: ci-condition plugin: GitHub Actions@1.8.0
[go-semantic-release]: provider plugin: GitHub@1.[14](https://github.com/tcpaddock/shiplot/actions/runs/4163834856/jobs/7204752534#step:4:15).0
[go-semantic-release]: getting default branch...
[go-semantic-release]: found default branch: main
[go-semantic-release]: found current branch: alpha
[go-semantic-release]: found maintained version: 1-alpha
[go-semantic-release]: found current sha: fdb9e06394646995e54adbc1a443aeadab80[20](https://github.com/tcpaddock/shiplot/actions/runs/4163834856/jobs/7204752534#step:4:21)b9
[go-semantic-release]: hooks plugins: GoReleaser@1.6.0
[go-semantic-release]: running CI condition...
[go-semantic-release]: getting latest release...
[go-semantic-release]: found version: 1.0.0-alpha.4
[go-semantic-release]: getting commits...
[go-semantic-release]: analyzing commits...
[go-semantic-release]: commit-analyzer plugin: default@1.11.0
[go-semantic-release]: calculating new version...
[go-semantic-release]: no change
[go-semantic-release]: stopping plugins...
christophwitzko commented 1 year ago

Hi @tcpaddock, this definitely should not happen.

Can you try to add the following to the GitHub Actions semantic-release config:

with:
  ...
  custom-arguments: --provider-opt github_use_compare_commits=true

This will use the compare commits API from GitHub and should resolve your issue.

For more context: https://github.com/go-semantic-release/provider-github/issues/5