From 2b24582d8f4f224d4ab98cf849953c8d08b71208 Mon Sep 17 00:00:00 2001 From: Aegis AI Assistant Date: Sun, 16 Aug 2026 09:20:00 -0700 Subject: [PATCH] fix: rm -rf before restoring .github/workflows, preventively MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This repo's upstream-sync.yml has the same latent bug just found and fixed in mlx-swift-lm's sibling workflow: git checkout -- only overwrites paths that already exist in , so it silently fails to remove a brand-new workflow file upstream just added (which origin/main never had). This repo hasn't hit it yet only because upstream mlx-swift hasn't added a new workflow file recently — the same upstream org (ml-explore) adding one here is only a matter of time, and it would reproduce mlx-swift-lm's exact failure. --- .github/workflows/upstream-sync.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/upstream-sync.yml b/.github/workflows/upstream-sync.yml index 9fd5408f7..68a64e40d 100644 --- a/.github/workflows/upstream-sync.yml +++ b/.github/workflows/upstream-sync.yml @@ -34,7 +34,18 @@ jobs: run: | git checkout -B sync/upstream-latest origin/main git checkout upstream/main -- . + # GITHUB_TOKEN can never push a commit that touches .github/workflows/*, + # regardless of the permissions: block above. `rm -rf` before restoring + # is required, not optional: `git checkout -- .github/workflows` + # only overwrites paths that already exist in — a file upstream + # just added there (which origin/main never had) would sit in the + # working tree/index untouched, and the push would get rejected for + # that new file. This repo hasn't hit it yet only because upstream + # mlx-swift hasn't added a new workflow file recently; mlx-swift-lm's + # sibling sync did hit it, verified locally, and this mirrors the fix. + rm -rf .github/workflows git checkout origin/main -- .github/workflows + git add -A .github/workflows git commit -m "chore: sync with upstream/main" || true git push -f origin sync/upstream-latest