diff --git a/.github/workflows/format-python-code.yml b/.github/workflows/format-python-code.yml index 6473037..9bb2faa 100644 --- a/.github/workflows/format-python-code.yml +++ b/.github/workflows/format-python-code.yml @@ -20,6 +20,10 @@ jobs: uses: actions/checkout@v6 with: token: ${{ secrets.GITHUB_TOKEN }} + # pull_request ではマージ commit が detached HEAD でチェックアウトされ + # git push が失敗する。PR の元ブランチを明示してブランチ状態にする。 + # push(main)イベント時は github.head_ref が空なので既定の挙動になる。 + ref: ${{ github.head_ref }} - name: Set up Python uses: actions/setup-python@v6