Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -70,13 +70,20 @@ if [[ "$(git describe --always)" != "$new_tag" ]]; then
70
70
fi
71
71
72
72
# This returns the tag before the current tag.
73
- old_tag=" $( git describe --abbrev=0 --tags " $( git rev-list --tags --skip=1 --max-count=1) " ) "
73
+ old_tag=" $( git describe --abbrev=0 HEAD^1) "
74
+
75
+ # For dry-run builds we want to use the SHA instead of the tag, because the new
76
+ # tag probably doesn't exist.
77
+ changelog_range=" $old_tag ..$new_tag "
78
+ if [[ " $dry_run " == 1 ]]; then
79
+ changelog_range=" $old_tag ..$( git rev-parse --short HEAD) "
80
+ fi
74
81
75
82
# Craft the release notes.
76
83
release_notes="
77
84
## Changelog
78
85
79
- $( git log --no-merges --pretty=format:" - %h %s" " $old_tag .. $new_tag " )
86
+ $( git log --no-merges --pretty=format:" - %h %s" " $changelog_range " )
80
87
81
88
## Container Image
82
89
- \` docker pull $( execrelative ./image_tag.sh --version " $version " ) \`
0 commit comments