From eaaa39c39ba69574f50a9b6cc2e34cfb166f5225 Mon Sep 17 00:00:00 2001 From: csh Date: Thu, 12 Mar 2026 09:47:12 +0800 Subject: [PATCH] :bug: fix(ci): prevent stale superpowers sync from restoring skills block remove the stale superpowers list block from SKILLS.md so the document routes to the source list only. clear assume-unchanged and skip-worktree flags in the sync workflow before refreshing the workspace, and add a regression test for that safeguard. --- .gitea/workflows/sync-superpowers.yml | 5 +++++ SKILLS.md | 19 ------------------- tests/test_superpowers_workflows.py | 5 +++++ 3 files changed, 10 insertions(+), 19 deletions(-) diff --git a/.gitea/workflows/sync-superpowers.yml b/.gitea/workflows/sync-superpowers.yml index 4a9ba4b..3fb3888 100644 --- a/.gitea/workflows/sync-superpowers.yml +++ b/.gitea/workflows/sync-superpowers.yml @@ -38,6 +38,11 @@ jobs: if [ -d "$REPO_DIR" ]; then if [ -d "$REPO_DIR/.git" ]; then cd "$REPO_DIR" + # Clear local index flags so checked-out workflow/script files + # always refresh from the latest main branch contents. + git ls-files -v | awk '/^[a-zS] / {sub(/^[a-zS] /, ""); print}' | while IFS= read -r path; do + git update-index --no-assume-unchanged --no-skip-worktree -- "$path" + done git clean -fdx git reset --hard git fetch --all --tags --force --prune --prune-tags diff --git a/SKILLS.md b/SKILLS.md index 93bdff4..62e29da 100644 --- a/SKILLS.md +++ b/SKILLS.md @@ -175,22 +175,3 @@ python docs/standards/playbook/scripts/playbook.py -config playbook.toml --- **最后更新**:2026-01-26 - -### Third-party Skills (superpowers) - - -- \ -- \ -- \ -- \ -- \ -- \ -- \ -- \ -- \ -- \ -- \ -- \ -- \ -- \ - diff --git a/tests/test_superpowers_workflows.py b/tests/test_superpowers_workflows.py index 2049341..33adb72 100644 --- a/tests/test_superpowers_workflows.py +++ b/tests/test_superpowers_workflows.py @@ -13,6 +13,11 @@ class SuperpowersWorkflowTests(unittest.TestCase): text = SYNC_WORKFLOW.read_text(encoding="utf-8") self.assertIn("workflow_dispatch:", text) + def test_sync_workflow_clears_stale_index_flags(self): + text = SYNC_WORKFLOW.read_text(encoding="utf-8") + self.assertIn("git update-index --no-assume-unchanged", text) + self.assertIn("--no-skip-worktree", text) + def test_sync_workflow_runs_from_latest_main(self): text = SYNC_WORKFLOW.read_text(encoding="utf-8") self.assertIn('TARGET_BRANCH: "main"', text)