Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: Optimize the monitoring of command changes to avoid invalid pul... #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
XXPermanentXX merged 2 commits into main from feat/auto-generate-skills
Jun 5, 2026
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 26 additions & 10 deletions .github/workflows/sync-bailian-cli-skill-reference.yml
View file Open in desktop
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# When the CLI command catalog changes, regenerate skill reference markdown,
# push to modelstudioai/skills, and open a PR against main.
# When CLI command definitions or the reference generator change, regenerate skill
# reference markdown, push to modelstudioai/skills, and open a PR against main.
#
# Required repository secret (Settings → Secrets and variables → Actions):
# SKILLS_SYNC_TOKEN — PAT with repo scope on modelstudioai/skills:
Expand All @@ -13,7 +13,15 @@ on:
push:
branches: [main]
paths:
- "packages/cli/src/commands/catalog.ts"
- "packages/cli/src/commands/**"
- "tools/generate-reference.ts"
- "packages/core/src/types/command.ts"
paths-ignore:
# Tests and fixtures under commands/ do not affect generated reference.
- "packages/cli/src/commands/**/*.test.ts"
- "packages/cli/src/commands/**/*.spec.ts"
- "packages/cli/src/commands/**/__fixtures__/**"
- "packages/cli/src/commands/**/__tests__/**"
schedule:
- cron: "0 19 * * *"
workflow_dispatch:
Expand Down Expand Up @@ -78,18 +86,20 @@ jobs:

SHORT_SHA="${CLI_SHA:0:7}"
BRANCH="sync/bailian-cli-reference-${SHORT_SHA}"
REFERENCE_PATH="skills/bailian-cli/reference"

git checkout -B "$BRANCH"

SRC="${GITHUB_WORKSPACE}/tools/generated/reference"
DEST="${GITHUB_WORKSPACE}/skills-repo/skills/bailian-cli/reference"
DEST="${GITHUB_WORKSPACE}/skills-repo/${REFERENCE_PATH}"
mkdir -p "$DEST"
rsync -a --delete "$SRC/" "$DEST/"

# Stage before checking: untracked new files are invisible to `git diff` until added.
git add -A -- skills/bailian-cli/reference
# Untracked new files are invisible to `git diff` until added.
git add -A -- "$REFERENCE_PATH"

if git diff --cached --quiet; then
echo "No changes to skill reference; exiting."
if git diff --cached --quiet origin/main -- "$REFERENCE_PATH"; then
echo "No diff vs origin/main under ${REFERENCE_PATH}; exiting."
exit 0
fi

Expand All @@ -99,7 +109,13 @@ jobs:
-m "Synced from modelstudioai/cli@${CLI_SHA}" \
-m "Workflow run: ${RUN_URL}"

# Branch is automation-owned; lease-safe force covers re-runs / updated main base.
# Re-fetch before push: main may have been updated with the same reference content.
git fetch origin main
if git diff --quiet origin/main HEAD -- "$REFERENCE_PATH"; then
echo "Committed tree matches origin/main; skipping push and PR."
exit 0
fi

git push -u origin "$BRANCH" --force-with-lease

EXISTING=$(gh pr list --repo modelstudioai/skills --head "$BRANCH" --state open --json number --jq 'length')
Expand All @@ -108,7 +124,7 @@ jobs:
{
echo "## Summary"
echo ""
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}\`)."
echo "- Regenerated \`skills/bailian-cli/reference/*.md\` from CLI command definitions at [\`modelstudioai/cli\`](https://github.com/modelstudioai/cli) commit \`${SHORT_SHA}\`."
echo ""
echo "## Test plan"
echo ""
Expand Down

AltStyle によって変換されたページ (->オリジナル) /