fix: resolve goreleaser v2.6 archives.format deprecation#103
fix: resolve goreleaser v2.6 archives.format deprecation#103SantiagoDePolonia merged 2 commits intomainfrom
Conversation
Replace deprecated `format` with `formats` list, add Windows zip override, improve changelog config with GitHub attribution and expanded noise filters, and add release footer with changelog link. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add doc:/Docs:/perf: prefix filters and exclude Revert/Merge commits to reduce noise in generated changelogs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
📝 WalkthroughWalkthroughThe pull request updates the GoReleaser configuration file to refine the release artifact archival strategy, extend changelog metadata, broaden changelog filtering criteria, and introduce a footer linking to full release notes comparing versions. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.goreleaser.yaml:
- Around line 63-65: The release.footer currently always emits a GitHub compare
URL using {{ .PreviousTag }} and {{ .Tag }}, which produces an invalid link on
the first release when {{ .PreviousTag }} is empty; update the release.footer
template to conditionally render the compare URL only if {{ .PreviousTag }} is
non-empty (guarding the template with an if/else around the current footer
content), and provide an alternate footer (e.g., a simple link or message
referencing only {{ .Tag }}) when {{ .PreviousTag }} is empty so the generated
footer is always valid.
| release: | ||
| footer: | | ||
| **Full Changelog**: https://github.com/ENTERPILOT/GOModel/compare/{{ .PreviousTag }}...{{ .Tag }} |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Verify whether this repo has enough tags for a compare footer to always work.
tag_count="$(git tag | wc -l | tr -d ' ')"
echo "tag_count=${tag_count}"
git tag --sort=version:refname | tail -n 5Repository: ENTERPILOT/GOModel
Length of output: 73
🌐 Web query:
GoReleaser PreviousTag empty first release template documentation
💡 Result:
In GoReleaser templates, .PreviousTag is “the previous git tag, or empty if no previous tags”—so on your first release it will be an empty string. [1]
To handle that in a template, guard it with a conditional, e.g.:
{{- if .PreviousTag -}}
Changes since {{ .PreviousTag }}
{{- else -}}
First release
{{- end -}}
Source: GoReleaser “Templates” docs (common fields table). [1]
Handle first-release footer when PreviousTag is empty.
Line 65 builds a compare URL from {{ .PreviousTag }}; on a first release this will be empty because the repository has no tags yet. This creates an invalid GitHub compare link (...{{ .Tag }}). Guard the footer template with a conditional to handle this edge case:
💡 Proposed safe footer template
release:
footer: |
- **Full Changelog**: https://github.com/ENTERPILOT/GOModel/compare/{{ .PreviousTag }}...{{ .Tag }}
+ {{- if .PreviousTag }}
+ **Full Changelog**: https://github.com/ENTERPILOT/GOModel/compare/{{ .PreviousTag }}...{{ .Tag }}
+ {{- else }}
+ **Release**: https://github.com/ENTERPILOT/GOModel/releases/tag/{{ .Tag }}
+ {{- end }}🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.goreleaser.yaml around lines 63 - 65, The release.footer currently always
emits a GitHub compare URL using {{ .PreviousTag }} and {{ .Tag }}, which
produces an invalid link on the first release when {{ .PreviousTag }} is empty;
update the release.footer template to conditionally render the compare URL only
if {{ .PreviousTag }} is non-empty (guarding the template with an if/else around
the current footer content), and provide an alternate footer (e.g., a simple
link or message referencing only {{ .Tag }}) when {{ .PreviousTag }} is empty so
the generated footer is always valid.
Replace deprecated
formatwithformatslist, add Windows zip override, improve changelog config with GitHub attribution and expanded noise filters, and add release footer with changelog link.Summary by CodeRabbit