Attempt to work around strage git behaviour in github

This commit is contained in:
Hamish Coleman 2021-10-31 15:59:06 +00:00
parent 3371a50d5a
commit e63b0f3c53

View File

@ -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 ================