From 949f30e903780449a73de25c4a3849626f14f382 Mon Sep 17 00:00:00 2001 From: Thomas Neidhart Date: Mon, 18 Dec 2023 20:01:02 +0100 Subject: [PATCH] Support pinning of the action Signed-off-by: Thomas Neidhart --- lib/find-current-git-tag.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/find-current-git-tag.sh b/lib/find-current-git-tag.sh index 26bd380..2c3b40f 100755 --- a/lib/find-current-git-tag.sh +++ b/lib/find-current-git-tag.sh @@ -24,11 +24,11 @@ fi echo >&2 "Determining Git tag for $github_repository/$git_ref" echo >&2 "Cloning repository $github_repository at ref $git_ref" -git clone --bare --single-branch --branch "$git_ref" "https://github.com/$github_repository" bare_pr_preview +git clone --bare "https://github.com/$github_repository" bare_pr_preview cd bare_pr_preview || exit 1 -action_version=$(git describe --tags --match "v*.*.*" || git describe --tags || git rev-parse HEAD) +action_version=$(git describe --tags --match "v*.*.*" "$git_ref" || git describe --tags "$git_ref" || git rev-parse HEAD) echo "$action_version" exit 0