From 19c999c92cb709715f112079c18adb5579767aa9 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 6 Jul 2026 12:15:57 +0000 Subject: [PATCH] fix(ci): monitor publish fails once the data branch exists The last two scheduled sweeps ran to completion but threw away their results at the commit step: 'git checkout -B registry-snapshots origin/registry-snapshots' aborts with 'untracked working tree files would be overwritten by checkout' because the freshly generated latest.json / snapshot-*.json sit untracked in data/registry-snapshots/ and collide with the branch's tracked versions. The first run escaped this (orphan-branch path, no existing branch to collide with). Fix: after copying the fresh files to $tmp, rm -rf data/registry-snapshots before the checkout so nothing blocks the switch, then overlay them back. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01DNoTXU8k3pfSBzR7aJubqL --- .github/workflows/registry-monitor.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/registry-monitor.yml b/.github/workflows/registry-monitor.yml index 61d106c..c49d246 100644 --- a/.github/workflows/registry-monitor.yml +++ b/.github/workflows/registry-monitor.yml @@ -126,9 +126,14 @@ jobs: git config user.name "github-actions[bot]" git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - # Preserve the freshly generated snapshot files across the branch switch. + # Save the freshly generated snapshot files, then clear them from the + # working tree. Once the data branch exists, `git checkout` refuses to + # switch when untracked files here would be overwritten by the branch's + # tracked versions — so we stash to $tmp and remove them first, then + # overlay them back after the switch. tmp="$(mktemp -d)" cp -a data/registry-snapshots/. "$tmp/" + rm -rf data/registry-snapshots # Move onto the data branch (create an orphan branch on the first run). if git rev-parse --verify origin/registry-snapshots >/dev/null 2>&1; then