Skip to content

fix: rm -rf before restoring .github/workflows, preventively - #14

Merged
solderzzc merged 1 commit into
mainfrom
fix/upstream-sync-restore-new-workflow-files
Aug 16, 2026
Merged

fix: rm -rf before restoring .github/workflows, preventively#14
solderzzc merged 1 commit into
mainfrom
fix/upstream-sync-restore-new-workflow-files

Conversation

@solderzzc

Copy link
Copy Markdown
Member

Summary

Applies the same preventive fix as mlx-swift-lm#59 to this repo's identically-structured upstream-sync.yml.

Root cause

`git checkout -- ` only overwrites paths that already exist in ``. It does not delete a file present in the working tree/index but absent from `` — so a brand-new workflow file the merge just pulled in from upstream (which `origin/main` never had) would survive the restore step untouched, and the push would get rejected for it, exactly like mlx-swift-lm's sync just did.

This repo's sync has succeeded on every run so far only because upstream mlx-swift hasn't added a new workflow file recently — the bug is latent, not yet triggered, in this specific workflow.

Fix

`rm -rf .github/workflows` before the restore checkout, then `git add -A` to stage the deletion too.

Verification

Same fix, verified against the exact scenario in mlx-swift-lm#59 via a local git sandbox reproducing origin-lacks-file / upstream-adds-file / merge / restore.

This repo's upstream-sync.yml has the same latent bug just found and
fixed in mlx-swift-lm's sibling workflow: git checkout <ref> -- <path>
only overwrites paths that already exist in <ref>, 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.
@solderzzc
solderzzc merged commit 5639a6d into main Aug 16, 2026
7 checks passed
@solderzzc
solderzzc deleted the fix/upstream-sync-restore-new-workflow-files branch August 16, 2026 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant