From ba6c693b012960e158398ee1dcd1b95ccbd6b779 Mon Sep 17 00:00:00 2001 From: Taremin Date: Sat, 4 Jul 2026 09:31:13 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=86=8D=E5=88=A9=E7=94=A8=E5=8F=AF?= =?UTF-8?q?=E8=83=BD=E3=83=AF=E3=83=BC=E3=82=AF=E3=83=95=E3=83=AD=E3=83=BC?= =?UTF-8?q?=E5=91=BC=E3=81=B3=E5=87=BA=E3=81=97=E6=99=82=E3=81=AE=E3=83=96?= =?UTF-8?q?=E3=83=A9=E3=83=B3=E3=83=81=E5=8F=82=E7=85=A7=E4=B8=8D=E6=95=B4?= =?UTF-8?q?=E5=90=88=E3=81=A8=E3=83=88=E3=83=AA=E3=82=AC=E3=83=BC=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6=E3=81=AE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PRマージのトリガーによる自動リリースプロセス全体がエラーなく連動して動作するよう、不備をすべて解消 - bump-and-tag.yml の paths-ignore から .github/workflows/** を削除 - release.yml および publish.yml に workflow_call 用 of tag 引数を追加し、 checkout ref に適用 - release.yml のバージョン取得処理で tag 引数がある場合はそれを優先するようフォールバック処理を追加 - bump-and-tag.yml の呼び出し部分に tag 引数の引き渡しを追加 --- .github/workflows/bump-and-tag.yml | 5 ++++- .github/workflows/publish.yml | 6 ++++++ .github/workflows/release.yml | 14 +++++++++++++- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/.github/workflows/bump-and-tag.yml b/.github/workflows/bump-and-tag.yml index b06192d..a6263a5 100644 --- a/.github/workflows/bump-and-tag.yml +++ b/.github/workflows/bump-and-tag.yml @@ -6,7 +6,6 @@ on: - master paths-ignore: - 'js/index.js' - - '.github/workflows/**' permissions: contents: write @@ -87,9 +86,13 @@ jobs: trigger-release: needs: bump-version uses: ./.github/workflows/release.yml + with: + tag: ${{ needs.bump-version.outputs.tag }} secrets: inherit trigger-publish: needs: bump-version uses: ./.github/workflows/publish.yml + with: + tag: ${{ needs.bump-version.outputs.tag }} secrets: inherit diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 365f3b3..bd3422a 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -7,6 +7,10 @@ on: paths: - "pyproject.toml" workflow_call: + inputs: + tag: + required: false + type: string permissions: issues: write @@ -19,6 +23,8 @@ jobs: steps: - name: Check out code uses: actions/checkout@v4 + with: + ref: ${{ inputs.tag || github.ref }} - name: Setup Node.js uses: actions/setup-node@v4 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f5d40f5..51c9b3f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,6 +5,10 @@ on: tags: - "v[0-9]+\\.[0-9]+\\.[0-9]+" workflow_call: + inputs: + tag: + required: false + type: string jobs: create_release: @@ -15,6 +19,7 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 + ref: ${{ inputs.tag || github.ref }} - name: Setup Node.js uses: actions/setup-node@v4 with: @@ -29,7 +34,14 @@ jobs: run: | REPOSITORY=$(echo ${{ github.event.repository.name }}) echo "repository=$REPOSITORY" >> "$GITHUB_OUTPUT" - VERSION=$(basename ${{ github.ref }}) + + INPUT_TAG="${{ inputs.tag }}" + if [ -n "$INPUT_TAG" ]; then + VERSION="$INPUT_TAG" + else + VERSION=$(basename ${{ github.ref }}) + fi + echo "version=$VERSION" >> "$GITHUB_OUTPUT" VERSION_STRING=$(echo $VERSION | sed -e "s#\.#_#g") echo "version_string=$VERSION_STRING" >> "$GITHUB_OUTPUT"