Skip to content

Commit 7423084

Browse files
committed
ci: detach HEAD before fetching origin refs
git refused 'fetch into branch ci/forge-mirror checked out at ...' because the workflow runs on that branch and the same fetch refspec overwrites its own ref. Detach HEAD first so no branch is current and the fetch + force-update is allowed.
1 parent 059a3fc commit 7423084

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

.github/workflows/tangle.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ jobs:
3737
# the destination instead of as proper branches. Materialize them
3838
# under refs/heads/* first so the mirror push lands them as real
3939
# branches that forge can render.
40+
#
41+
# Detach HEAD before fetching so the fetch can overwrite
42+
# refs/heads/<currently-checked-out-branch> without git refusing.
43+
git -c advice.detachedHead=false checkout --detach
4044
git fetch origin '+refs/heads/*:refs/heads/*' '+refs/tags/*:refs/tags/*'
4145
git remote add tangled git@knot.blacksky.community:blackskyweb.xyz/rsky
4246
git push --mirror tangled

0 commit comments

Comments
 (0)