From 27a3a802c52b805770688ab5b1c64133e312f16b Mon Sep 17 00:00:00 2001 From: Vlada Dusek Date: Sat, 18 Apr 2026 09:38:53 +0200 Subject: [PATCH] ci: Fix docs release failing on detached HEAD The post-publish doc release job invokes manual_release_docs.yaml with a commit SHA, so actions/checkout leaves the repo in detached HEAD and the hand-rolled git push fails. Switch to EndBug/add-and-commit with new_branch set to the default branch, and apply the same fix to manual_version_docs.yaml where the same latent bug existed. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/manual_release_docs.yaml | 14 +++++++------- .github/workflows/manual_version_docs.yaml | 2 ++ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/manual_release_docs.yaml b/.github/workflows/manual_release_docs.yaml index 491bea03..6f933578 100644 --- a/.github/workflows/manual_release_docs.yaml +++ b/.github/workflows/manual_release_docs.yaml @@ -71,13 +71,13 @@ jobs: run: uv run poe update-docs-theme - name: Commit the updated package.json and lockfile - run: | - git config user.name 'GitHub Actions' - git config user.email 'github-actions[bot]@users.noreply.github.com' - git add website/package.json - git add website/yarn.lock - git diff-index --quiet HEAD || git commit -m 'chore: Automatic docs theme update [skip ci]' || true - git push + uses: EndBug/add-and-commit@v10 + with: + add: website/package.json website/yarn.lock + message: "chore: Automatic docs theme update [skip ci]" + default_author: github_actions + # Required: checkout may leave a detached HEAD when invoked with a SHA ref. + new_branch: ${{ github.event.repository.default_branch }} - name: Build docs run: uv run poe build-docs diff --git a/.github/workflows/manual_version_docs.yaml b/.github/workflows/manual_version_docs.yaml index b9f99886..c8946fa4 100644 --- a/.github/workflows/manual_version_docs.yaml +++ b/.github/workflows/manual_version_docs.yaml @@ -123,6 +123,8 @@ jobs: add: website/versioned_docs website/versioned_sidebars website/versions.json message: "docs: Version docs for v${{ steps.snapshot.outputs.version }} [skip ci]" default_author: github_actions + # Required: checkout may leave a detached HEAD when invoked with a SHA ref. + new_branch: ${{ github.event.repository.default_branch }} - name: Resolve output commitish id: resolve_commitish