mirror of
https://github.com/pepaskopec-blip/Graduately.git
synced 2026-10-27 15:14:35 +00:00
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:
parent
ffba2b980c
commit
ccc31a9e01
1 changed files with 7 additions and 0 deletions
7
.github/workflows/build.yml
vendored
7
.github/workflows/build.yml
vendored
|
|
@ -298,7 +298,10 @@ jobs:
|
||||||
name: Mirror main to Forgejo
|
name: Mirror main to Forgejo
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
# Full history: Forgejo rejects "shallow update" when replacing main.
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
# Same rule as the macOS cert step: never put `secrets` in `if:`.
|
# Same rule as the macOS cert step: never put `secrets` in `if:`.
|
||||||
- name: Push main
|
- name: Push main
|
||||||
|
|
@ -313,6 +316,10 @@ jobs:
|
||||||
echo "No FORGEJO_TOKEN; skipping Forgejo main mirror."
|
echo "No FORGEJO_TOKEN; skipping Forgejo main mirror."
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
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="$(printf '%s' "${FORGEJO_USER:-}" | tr -d '\r\n')"
|
||||||
user="${user:-oauth2}"
|
user="${user:-oauth2}"
|
||||||
basic="$(printf '%s:%s' "$user" "$token" | base64 -w0)"
|
basic="$(printf '%s:%s' "$user" "$token" | base64 -w0)"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue