diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0b94fd0..7d9d51c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,7 +1,9 @@ name: Release on: - push: + workflow_run: + workflows: [CI] + types: [completed] branches: [main] concurrency: @@ -12,7 +14,7 @@ jobs: release: name: Bump version and publish release runs-on: ubuntu-latest - if: "!startsWith(github.event.head_commit.message, 'chore: bump version')" + if: "github.event.workflow_run.conclusion == 'success' && !startsWith(github.event.workflow_run.head_commit.message, 'chore: bump version')" permissions: contents: write @@ -32,8 +34,10 @@ jobs: # ------------------------------------------------------------------ # - name: Determine bump type id: bump + env: + MSG_RAW: ${{ github.event.workflow_run.head_commit.message }} run: | - MSG=$(echo "${{ github.event.head_commit.message }}" | head -1) + MSG=$(echo "$MSG_RAW" | head -1) if echo "$MSG" | grep -qiE "(BREAKING CHANGE|^[a-z]+(\([^)]*\))?!:)"; then echo "type=major" >> "$GITHUB_OUTPUT" elif echo "$MSG" | grep -qE "^feat(\([^)]*\))?:"; then