From db5211eb38c65dcd18cbb57e987df03fce2a40f9 Mon Sep 17 00:00:00 2001 From: Luis Gracia Date: Sat, 25 Mar 2023 00:08:40 +1300 Subject: [PATCH] Support actions triggered by a tag (#96) 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 ff38417..f87a4b3 100755 --- a/cr.sh +++ b/cr.sh @@ -234,7 +234,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 }