From 9435a4a11a18a158d1c936c9addc2fa794ee5d9e Mon Sep 17 00:00:00 2001 From: katspaugh <381895+katspaugh@users.noreply.github.com> Date: Mon, 18 Dec 2023 15:17:20 +0100 Subject: [PATCH] Chore: create a release only if PR is merged (#3028) --- .github/workflows/tag-release.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tag-release.yml b/.github/workflows/tag-release.yml index 6e23c98452..eff7cb321f 100644 --- a/.github/workflows/tag-release.yml +++ b/.github/workflows/tag-release.yml @@ -8,27 +8,26 @@ on: jobs: tag-release: + if: github.event.pull_request.merged == true runs-on: ubuntu-latest steps: - name: Checkout - if: github.event.pull_request.merged == true uses: actions/checkout@v2 with: fetch-depth: 0 - name: Extract version - if: github.event.pull_request.merged == true id: version run: | NEW_VERSION=$(node -p 'require("./package.json").version') echo "version=v$NEW_VERSION" >> $GITHUB_OUTPUT - name: Create a git tag - if: github.event.pull_request.merged == true + if: steps.version.outputs.version run: git tag ${{ steps.version.outputs.version }} && git push --tags - name: GitHub release - if: success() + if: steps.version.outputs.version uses: softprops/action-gh-release@v1 id: create_release with: