From 99be64c610095ca0a48c5ea17fa6737bcd517a1f Mon Sep 17 00:00:00 2001 From: stefan judis Date: Wed, 24 Jun 2026 11:34:15 +0200 Subject: [PATCH] fix: stage skills before the change check in sync workflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git diff (no --cached) ignores untracked files, so a brand-new file — a new skill directory, or a new references/*.md — read as no change and the job exited before git add. Only edits and deletions to already-tracked files ever propagated. Stage first, then gate on the staged diff so new files are seen. --- .github/workflows/sync.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml index 6e96f83..a01308f 100644 --- a/.github/workflows/sync.yml +++ b/.github/workflows/sync.yml @@ -29,12 +29,16 @@ jobs: - name: Commit and push if changed run: | - if git diff --quiet skills/; then + # Stage first, then gate on the staged diff. `git diff` (no --cached) + # ignores untracked files, so a brand-new file (a new skill, or a new + # reference) would be invisible here and the job would exit before + # committing it. + git add skills/ + if git diff --cached --quiet skills/; then echo "No skill changes — nothing to commit." exit 0 fi git config user.name "github-actions[bot]" git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - git add skills/ git commit -m "chore: sync skills" git push