From 7c1e965b4291eb09860486ddbed6cabe1dfca143 Mon Sep 17 00:00:00 2001 From: Luis Gracia Date: Tue, 12 Oct 2021 11:59:03 -0400 Subject: [PATCH] Support actions triggered by a tag 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 --- cr.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cr.sh b/cr.sh index a8830d6..45ced63 100755 --- a/cr.sh +++ b/cr.sh @@ -226,7 +226,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 }