From 71021abd9763754c440070a86b3ac5c2d81f96c8 Mon Sep 17 00:00:00 2001 From: Hamish Coleman Date: Sun, 31 Oct 2021 16:43:05 +0000 Subject: [PATCH] Try a different way to fetch the right tag data --- .github/workflows/tests.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ac4854a..990fad4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -503,11 +503,18 @@ jobs: # normally, `git for-each-ref refs/tags` will show annotated tags # with a type of "tag" and lightweight with type "commit". # But not in the github runner environment... + # + # Additionally, it seems that if you push both a commit and an annotated + # tag at the same time, two workflow actions start (as expected), and + # the annotated tag is visible in the "commit" action, but looks like a + # lightweight tag in the "tag" action + # # So, instead of: # TAGTYPE=$(git cat-file -t $GITHUB_REF) - # We build a workaround + # We try to build a workaround - name: Get Tag Type run: | + git pull --tags if git cat-file tag $GITHUB_REF; then TYPE=tag; else TYPE=commit; fi echo "::set-output name=TAGTYPE::$TYPE"