Allow Forgejo main mirror to push a full git history.

Checkout was shallow, so Forgejo rejected the force-update with "shallow update not allowed".

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
pepaskopec-blip 2026-09-23 21:20:09 +02:00
commit ccc31a9e01

View file

@ -298,7 +298,10 @@ jobs:
name: Mirror main to Forgejo
runs-on: ubuntu-latest
steps:
# Full history: Forgejo rejects "shallow update" when replacing main.
- uses: actions/checkout@v4
with:
fetch-depth: 0
# Same rule as the macOS cert step: never put `secrets` in `if:`.
- name: Push main
@ -313,6 +316,10 @@ jobs:
echo "No FORGEJO_TOKEN; skipping Forgejo main mirror."
exit 0
fi
# Belt-and-suspenders if a future checkout change re-shallows.
if git rev-parse --is-shallow-repository 2>/dev/null | grep -qx true; then
git fetch --unshallow origin
fi
user="$(printf '%s' "${FORGEJO_USER:-}" | tr -d '\r\n')"
user="${user:-oauth2}"
basic="$(printf '%s:%s' "$user" "$token" | base64 -w0)"