From 71521b81d86cc91f3c5944ea60f61e43e6fdfde7 Mon Sep 17 00:00:00 2001 From: Hamish Coleman Date: Sun, 31 Oct 2021 11:36:29 +0000 Subject: [PATCH] Only trigger release process on annotated tags Annotated tags are meant for releases while lightweight tags are meant for private or temporary object labels. For this reason, we should not trigger the automatic release actions unless we have an annotated tag. --- .github/workflows/tests.yml | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2c859d1..8893a62 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -479,8 +479,12 @@ jobs: name: binaries path: binaries - upload_release: - name: Upload Release Assets + # Given the clearly documented use of annotated tags to signal releases, + # it seems strange that there is no simple way to trigger actions if the + # tag is annotated. So we need to jump through some hoops. + # + get_tagtype: + name: Get the type of Tag if: startsWith(github.ref, 'refs/tags/') needs: - package_dpkg @@ -491,6 +495,18 @@ jobs: - binaries_linux_crosscompile runs-on: ubuntu-latest + steps: + - name: Set variable + run: | + echo '::set-output name=TAGTYPE::$(git cat-file -t $GITHUB_REF)' + + upload_release: + name: Upload Release Assets + if: steps.get_tagtype.outputs.TAGTYPE == 'tag' + needs: + - get_tagtype + runs-on: ubuntu-latest + steps: - name: Fetch all Artifacts uses: actions/download-artifact@v2