New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: allow to use .PreviousTag on templates #2683
Conversation
one problem with this: on the first tag, this will actually be a commit... 🤔 which per-se is not that bad, its just that the name will not convey what it actually is at some point 🤔 |
Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
Codecov Report
@@ Coverage Diff @@
## main #2683 +/- ##
==========================================
+ Coverage 84.76% 84.77% +0.01%
==========================================
Files 103 103
Lines 7883 7890 +7
==========================================
+ Hits 6682 6689 +7
Misses 985 985
Partials 216 216
Continue to review full report at Codecov.
|
@@ -203,6 +211,14 @@ func getTag() (string, error) { | |||
return tag, err | |||
} | |||
|
|||
func getPreviousTag(current string) (string, error) { | |||
if tag := os.Getenv("GORELEASER_PREVIOUS_TAG"); tag != "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Maybe a default |
I'm not intimately familiar with your code, but everything looked good to me. 👍 |
my comment was outdated, it will now be empty as stated in the docs... which makes sense, as if there is no previous tag, that's what I would expect... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍🏻
Previous tag will be available as a template field. It will be empty if there are no previous tag (e.g. first ever release of a repo).
Changelog still works by using the first commit on those cases (as it already does today).
refs #2669