From cbfd62388cfa0e14e7dab9406135a087dc5d08c5 Mon Sep 17 00:00:00 2001 From: Tarun Koyalwar Date: Tue, 15 Nov 2022 13:40:59 +0530 Subject: [PATCH] adds release checks (closes #19) --- .github/workflows/release-tag.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/release-tag.yml b/.github/workflows/release-tag.yml index 5f029e1..3c42075 100644 --- a/.github/workflows/release-tag.yml +++ b/.github/workflows/release-tag.yml @@ -13,14 +13,21 @@ jobs: uses: actions/checkout@v3 with: persist-credentials: false + + - name: Get Commit Count + id: get_commit + run: git rev-list `git rev-list --tags --no-walk --max-count=1`..HEAD --count | xargs -I {} echo COMMIT_COUNT={} >> $GITHUB_OUTPUT + - name: Create release and tag + if: ${{ steps.get_commit.outputs.COMMIT_COUNT > 0 }} id: tag_version uses: mathieudutour/github-tag-action@v6.1 with: github_token: ${{ secrets.GITHUB_TOKEN }} - name: Create a GitHub release + if: ${{ steps.get_commit.outputs.COMMIT_COUNT > 0 }} uses: actions/create-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}