You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# SKILLS_SYNC_TOKEN — PAT with repo scope on modelstudioai/skills:
@@ -13,7 +13,9 @@ on:
13
13
push:
14
14
branches: [main]
15
15
paths:
16
-
- "packages/cli/src/commands/catalog.ts"
16
+
- "packages/cli/src/commands/**"
17
+
- "tools/generate-reference.ts"
18
+
- "packages/core/src/types/command.ts"
17
19
schedule:
18
20
- cron: "0 19 * * *"
19
21
workflow_dispatch:
@@ -88,8 +90,9 @@ jobs:
88
90
# Stage before checking: untracked new files are invisible to `git diff` until added.
89
91
git add -A -- skills/bailian-cli/reference
90
92
91
-
if git diff --cached --quiet; then
92
-
echo "No changes to skill reference; exiting."
93
+
# Compare staged tree to skills repo main (explicit); no diff → no commit / no PR.
94
+
if git diff --cached --quiet origin/main; then
95
+
echo "No diff vs origin/main under skills/bailian-cli/reference; exiting."
93
96
exit 0
94
97
fi
95
98
@@ -102,13 +105,21 @@ jobs:
102
105
# Branch is automation-owned; lease-safe force covers re-runs / updated main base.
103
106
git push -u origin "$BRANCH" --force-with-lease
104
107
108
+
git fetch origin main
109
+
if git diff --quiet origin/main HEAD; then
110
+
echo "Branch tree matches origin/main; skipping PR creation."
111
+
git push origin --delete "$BRANCH"
112
+
echo "Deleted remote branch ${BRANCH} (no PR opened)."
113
+
exit 0
114
+
fi
115
+
105
116
EXISTING=$(gh pr list --repo modelstudioai/skills --head "$BRANCH" --state open --json number --jq 'length')
106
117
if [ "${EXISTING}" -eq 0 ]; then
107
118
BODY_FILE="$(mktemp)"
108
119
{
109
120
echo "## Summary"
110
121
echo ""
111
-
echo "- Regenerated \`skills/bailian-cli/reference/*.md\` from [\`packages/cli/src/commands/catalog.ts\`](https://github.com/modelstudioai/cli/blob/${CLI_SHA}/packages/cli/src/commands/catalog.ts) in [\`modelstudioai/cli\`](https://github.com/modelstudioai/cli) (commit \`${SHORT_SHA}\`)."
122
+
echo "- Regenerated \`skills/bailian-cli/reference/*.md\` from CLI command definitions at [\`modelstudioai/cli\`](https://github.com/modelstudioai/cli) commit \`${SHORT_SHA}\`."
0 commit comments