Browse Source

Attempt to work around strage git behaviour in github

pull/883/head
Hamish Coleman 3 years ago
parent
commit
e63b0f3c53
  1. 12
      .github/workflows/tests.yml

12
.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 ================

Loading…
Cancel
Save