🔧 chore(ci): use ci-bot identity for superpowers sync commits
Update Third-party Superpowers / Update thirdparty/skill snapshot (push) Successful in 1m0s Details

This commit is contained in:
csh 2026-02-28 11:27:35 +08:00
parent fa247a7b31
commit f7f2c57c89
3 changed files with 17 additions and 4 deletions

View File

@ -6,8 +6,8 @@ SUPERPOWERS_BRANCH="${SUPERPOWERS_BRANCH:-thirdparty/skill}"
SUPERPOWERS_DIR="${SUPERPOWERS_DIR:-superpowers}"
SUPERPOWERS_LIST="${SUPERPOWERS_LIST:-codex/skills/.sources/superpowers.list}"
TARGET_BRANCH="${TARGET_BRANCH:-main}"
COMMIT_AUTHOR_NAME="${COMMIT_AUTHOR_NAME:-playbook-bot}"
COMMIT_AUTHOR_EMAIL="${COMMIT_AUTHOR_EMAIL:-playbook-bot@local}"
COMMIT_AUTHOR_NAME="${COMMIT_AUTHOR_NAME:-ci-bot}"
COMMIT_AUTHOR_EMAIL="${COMMIT_AUTHOR_EMAIL:-ci-bot@local}"
cd "$REPO_DIR"

View File

@ -7,8 +7,8 @@ SNAPSHOT_DIR="${SNAPSHOT_DIR:-superpowers}"
SOURCE_FILE="${SOURCE_FILE:-${SNAPSHOT_DIR}/SOURCE.md}"
UPSTREAM_REPO="${UPSTREAM_REPO:-https://github.com/obra/superpowers.git}"
UPSTREAM_REF="${UPSTREAM_REF:-main}"
COMMIT_AUTHOR_NAME="${COMMIT_AUTHOR_NAME:-playbook-bot}"
COMMIT_AUTHOR_EMAIL="${COMMIT_AUTHOR_EMAIL:-playbook-bot@local}"
COMMIT_AUTHOR_NAME="${COMMIT_AUTHOR_NAME:-ci-bot}"
COMMIT_AUTHOR_EMAIL="${COMMIT_AUTHOR_EMAIL:-ci-bot@local}"
retry_cmd() {
local retries="$1"

View File

@ -5,6 +5,7 @@ ROOT = Path(__file__).resolve().parents[1]
SYNC_WORKFLOW = ROOT / ".gitea" / "workflows" / "sync-superpowers.yml"
AUTO_UPDATE_WORKFLOW = ROOT / ".gitea" / "workflows" / "update-thirdparty-superpowers.yml"
AUTO_UPDATE_SCRIPT = ROOT / ".gitea" / "ci" / "update_thirdparty_superpowers.sh"
SYNC_SCRIPT = ROOT / ".gitea" / "ci" / "sync_superpowers.sh"
class SuperpowersWorkflowTests(unittest.TestCase):
@ -38,6 +39,18 @@ class SuperpowersWorkflowTests(unittest.TestCase):
self.assertIn("ls-remote", text)
self.assertIn('git checkout -B "$TARGET_BRANCH" "origin/$TARGET_BRANCH"', text)
def test_ci_scripts_use_ci_bot_identity(self):
sync_text = SYNC_SCRIPT.read_text(encoding="utf-8")
update_text = AUTO_UPDATE_SCRIPT.read_text(encoding="utf-8")
self.assertIn('COMMIT_AUTHOR_NAME="${COMMIT_AUTHOR_NAME:-ci-bot}"', sync_text)
self.assertIn('COMMIT_AUTHOR_EMAIL="${COMMIT_AUTHOR_EMAIL:-ci-bot@local}"', sync_text)
self.assertIn('COMMIT_AUTHOR_NAME="${COMMIT_AUTHOR_NAME:-ci-bot}"', update_text)
self.assertIn(
'COMMIT_AUTHOR_EMAIL="${COMMIT_AUTHOR_EMAIL:-ci-bot@local}"',
update_text,
)
if __name__ == "__main__":
unittest.main()