Fix check whether we have a tag (#7901)
authorGereon Kremer <gkremer@stanford.edu>
Thu, 13 Jan 2022 00:14:06 +0000 (16:14 -0800)
committerGitHub <noreply@github.com>
Thu, 13 Jan 2022 00:14:06 +0000 (00:14 +0000)
This PR fixes a subtle issue with the docs upload for releases. While most of the context of the original action is passed into the docs upload action, the git ref changes from refs/tags/... to refs/heads/.... However, we still can check the current ref against the head_branch of the original workflow.

.github/workflows/docs_upload.yml

index 937496d0ae831e8f7512ad66a84bdca101379e13..06e207513cc82c838ed192645f8f4b6a828650b4 100644 (file)
@@ -62,7 +62,7 @@ jobs:
       - name: Setup Context
         run: |
           HASH=${{ github.event.workflow_run.head_commit.id }}
-          ISTAG=${{ startsWith(github.ref, 'refs/tags/') }}
+          ISTAG=${{ endsWith(github.ref, github.event.workflow_run.head_branch) }}
           if [ "$ISTAG" = true ] ; then
             NAME=${{ github.event.workflow_run.head_branch }}
             echo "Identified tag $NAME"