From f36da8a11a87988ff393cd9a65ef4a016bf4a9fb Mon Sep 17 00:00:00 2001 From: Matthias Kay Date: Thu, 23 May 2024 23:04:32 +0200 Subject: [PATCH] fix: find the nearest tag for workflow updates (#33) # Description The `head` of the default branch might not be tagged, i.e. `ci` commit, ... We now find the latest tag in the commit history to be able to create the comment when updating the workflows. # Verification Locally. --- update-workflows.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/update-workflows.sh b/update-workflows.sh index 09e33c9..c3323ff 100755 --- a/update-workflows.sh +++ b/update-workflows.sh @@ -152,7 +152,7 @@ do # add a reference to this repository which holds the workflow commit_sha=$(git rev-parse HEAD) - tag=$(git describe --tags --exact-match 2>/dev/null || true) + tag=$(git describe --tags "$(git rev-list --tags --max-count=1)" || true) file_to_include="uses: Hapag-Lloyd/Workflow-Templates/.github/workflows/$base_name@$commit_sha # $tag"