fix: CI always syncs from local repo (checkout token unreliable)

The actions/checkout@v4 step fails with stale Gitea token but leaves
a cached .git dir, preventing the fallback from triggering. Now we
always rsync from ~/archy/ which is kept up-to-date via git pull.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Dorian 2026-04-02 19:17:40 +01:00
parent aa957d0e87
commit fea256c5a8

View File

@ -17,17 +17,16 @@ jobs:
clean: true
continue-on-error: true
- name: Sync from local repo (fallback when checkout fails)
- name: Sync from local repo (always — checkout token is unreliable)
run: |
# Always pull latest in local repo so fallback is current
# Pull latest into local repo
cd /home/archipelago/archy && git pull origin main 2>/dev/null || true
# If checkout failed (no .git), copy from local repo
if [ ! -d ".git" ] || [ ! -f "core/archipelago/Cargo.toml" ]; then
echo "Checkout failed — syncing from local repo"
# Always sync from local repo to ensure latest code
echo "Syncing workspace from local repo..."
rsync -a --delete --exclude='.git' --exclude='target/' --exclude='node_modules/' \
/home/archipelago/archy/ ./ 2>/dev/null || cp -a /home/archipelago/archy/* . 2>/dev/null
fi
/home/archipelago/archy/ ./ 2>/dev/null || cp -a /home/archipelago/archy/* . 2>/dev/null || true
echo "Source version: $(grep '^version' core/archipelago/Cargo.toml 2>/dev/null)"
echo "Latest commit: $(cd /home/archipelago/archy && git log --oneline -1 2>/dev/null)"
- name: Build backend
run: |