diff --git a/.github/workflows/codePush.yml b/.github/workflows/codePush.yml index 4b27f4ab..c963bf68 100644 --- a/.github/workflows/codePush.yml +++ b/.github/workflows/codePush.yml @@ -67,7 +67,20 @@ jobs: token: ${{ secrets.MY_REPO_PAT }} submodules: recursive persist-credentials: true + - name: Check if tag exists + id: check_tag + run: | + TAG_NAME="${{ needs.generate.outputs.package_version }}" + TAG_EXISTS=$(git tag -l "$TAG_NAME") + if [ "$TAG_EXISTS" ]; then + echo "Tag $TAG_NAME already exists." + echo "::set-output name=tag_exists::true" + else + echo "Tag $TAG_NAME does not exist." + echo "::set-output name=tag_exists::false" + fi - name: Create Git tag + if: steps.check_tag.outputs.tag_exists == 'false' run: | TAG_NAME="${{ needs.generate.outputs.package_version }}" git config --local user.email "${{ github.actor }}@users.noreply.github.com"