Skip to content

Commit

Permalink
Support actions triggered by a tag
Browse files Browse the repository at this point in the history
The original helm/chart-releaser-action does not work on actions triggered by a tag because the `lookup_changed_charts` will never find differences in the charts. The problem is that `lookup_latest_tag` returns the tag that triggered the action, which is the current commit analyzed by `lookup_changed_charts`.

This simple solution skips the current (tagged) commit when searching for tags.

Signed-off-by: Luis Gracia <[email protected]>
  • Loading branch information
luisico committed Oct 12, 2021
1 parent 6eec360 commit 993fd72
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ install_chart_releaser() {
lookup_latest_tag() {
git fetch --tags > /dev/null 2>&1

if ! git describe --tags --abbrev=0 2> /dev/null; then
if ! git describe --tags --abbrev=0 HEAD~ 2> /dev/null; then
git rev-list --max-parents=0 --first-parent HEAD
fi
}
Expand Down

0 comments on commit 993fd72

Please sign in to comment.