From a427fb67f6b7885a191ae352d1020aa23b29cabf Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Thu, 9 May 2024 14:53:16 +0200 Subject: [PATCH] ci: Fetch tags before checking whether tag exists --- .github/workflows/ci.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d83bc9c4f..0d01ec703 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -120,13 +120,14 @@ jobs: steps: - uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5 with: - fetch-tags: true ssh-key: ${{ secrets.POSTGREST_SSH_KEY }} - name: Tag latest commit run: | cabal_version="$(grep -oP '^version:\s*\K.*' postgrest.cabal)" if [[ "$cabal_version" == *.*.* ]]; then + git fetch --tags + if [ -z "$(git tag --list "v$cabal_version")" ]; then git tag "v$cabal_version" git push origin "v$cabal_version"