From e0d10cf95f318cbd8c10757507fc03285d5d9e48 Mon Sep 17 00:00:00 2001 From: d-eigo-hara Date: Fri, 6 Feb 2026 18:19:21 +0900 Subject: [PATCH] fix: release --- .github/workflows/release.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 78e7ebe..7fdae83 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,12 +1,10 @@ name: Release on: - pull_request: + push: branches: - develop - main - types: - - closed permissions: contents: write @@ -14,7 +12,7 @@ permissions: jobs: develop: - if: github.event.pull_request.merged == true && github.base_ref == 'develop' + if: github.ref_name == 'develop' runs-on: ubuntu-latest @@ -34,7 +32,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} production: - if: github.event.pull_request.merged == true && github.base_ref == 'main' + if: github.ref_name == 'main' runs-on: ubuntu-latest @@ -44,6 +42,14 @@ jobs: - name: Checkout uses: actions/checkout@v6 + - name: Get PR Title for Version + id: pr + run: | + PR_TITLE=$(gh pr list --search "${{ github.sha }}" --state merged --json title --jq '.[0].title') + echo "TITLE=$PR_TITLE" >> "$GITHUB_OUTPUT" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Publish Release uses: release-drafter/release-drafter@v6 with: @@ -54,5 +60,5 @@ jobs: tag: ${{ env.VERSION }} version: ${{ env.VERSION }} env: + VERSION: ${{ steps.pr.outputs.TITLE }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - VERSION: ${{ github.event.pull_request.title }}