From e63b0f3c53cdbd2b6a2d2f23478482fd72402402 Mon Sep 17 00:00:00 2001 From: Hamish Coleman Date: Sun, 31 Oct 2021 15:59:06 +0000 Subject: [PATCH] Attempt to work around strage git behaviour in github --- .github/workflows/tests.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7fca895..b199c49 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -499,13 +499,23 @@ jobs: with: fetch-depth: 0 + # There is something strange with the github runners + # 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... + # So, instead of: + # TAGTYPE=$(git cat-file -t $GITHUB_REF) + # We build a workaround - name: Get Tag Type run: | - TAGTYPE=$(git cat-file -t $GITHUB_REF) + git cat-file tag $GITHUB_REF + if $? -eq 0; then TAGTYPE=tag; else TAGTYPE=commit; fi echo "::set-output name=TAGTYPE::$TAGTYPE" + echo ================Debug echo REF=$GITHUB_REF echo TAGTYPE=$TAGTYPE + echo ================ echo git for-each-ref refs/tags git for-each-ref refs/tags echo ================