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