Skip to content

Commit 6abec8f

Browse files
vdusekclaude
andcommitted
ci: Fix docs release failing on detached HEAD
When manual_release_docs.yaml is invoked with a commit SHA as ref (e.g. from doc_release_post_publish in on_master.yaml or from the stable release pipeline), actions/checkout leaves the repo in a detached HEAD state and the hand-rolled git push fails with "fatal: You are not currently on a branch." 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) <noreply@anthropic.com>
1 parent 87da1c2 commit 6abec8f

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

.github/workflows/manual_release_docs.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,13 @@ jobs:
7474
run: uv run poe update-docs-theme
7575

7676
- name: Commit the updated package.json and lockfile
77-
run: |
78-
git config user.name 'GitHub Actions'
79-
git config user.email 'github-actions[bot]@users.noreply.github.com'
80-
git add website/package.json
81-
git add website/yarn.lock
82-
git diff-index --quiet HEAD || git commit -m 'chore: Automatic docs theme update [skip ci]' || true
83-
git push
77+
uses: EndBug/add-and-commit@v10
78+
with:
79+
add: website/package.json website/yarn.lock
80+
message: "chore: Automatic docs theme update [skip ci]"
81+
default_author: github_actions
82+
# Required: checkout may leave a detached HEAD when invoked with a SHA ref.
83+
new_branch: ${{ github.event.repository.default_branch }}
8484

8585
- name: Build docs
8686
run: uv run poe build-docs

.github/workflows/manual_version_docs.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ jobs:
123123
add: website/versioned_docs website/versioned_sidebars website/versions.json
124124
message: "docs: Version docs for v${{ steps.snapshot.outputs.version }} [skip ci]"
125125
default_author: github_actions
126+
# Required: checkout may leave a detached HEAD when invoked with a SHA ref.
127+
new_branch: ${{ github.event.repository.default_branch }}
126128

127129
- name: Resolve output commitish
128130
id: resolve_commitish

0 commit comments

Comments
 (0)