From 59120903a05631c0445d5a7768ac215cb6de94a5 Mon Sep 17 00:00:00 2001 From: Matthias Wittgen Date: Tue, 27 Aug 2024 14:06:09 -0700 Subject: [PATCH] Skip if no tag defined --- .github/workflows/build.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 67bd3ac..9e3d223 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -81,9 +81,14 @@ jobs: prev_sha=$(git rev-list -1 "$prev_tag") echo "Previous tag ${prev_tag} (${prev_sha})" current_tag=${GITHUB_REF#refs/tags/} + if [ -z "$current_tag" ]; then + echo "Current ref is not a tag, skipping upload." + echo "skip=true" >> "$GITHUB_ENV" + exit 0 + fi current_sha=$(git rev-list -1 "$current_tag") echo "Current tag ${current_tag} (${current_sha})" - if [ -z ${current_tag} ] || [ "$current_sha" = "$prev_sha" ]; then + if [ "$current_sha" = "$prev_sha" ]; then echo "Skip upload" echo "skip=true" >> "$GITHUB_ENV" else