Skip to content

Commit 63a409e

Browse files
authored
ci: open a pull request when the agent skills update (#197)
1 parent cd6733d commit 63a409e

2 files changed

Lines changed: 45 additions & 0 deletions

File tree

‎.github/workflows/agent-skills.yml‎

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Update agent skills
2+
3+
on:
4+
schedule:
5+
- cron: "0 9 * * *"
6+
workflow_dispatch:
7+
8+
jobs:
9+
skills:
10+
runs-on: ubuntu-latest
11+
timeout-minutes: 5
12+
permissions:
13+
contents: write
14+
pull-requests: write
15+
steps:
16+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
17+
with:
18+
persist-credentials: false
19+
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
20+
with:
21+
node-version: 24.x
22+
- name: Update the skills in each skills-lock.json
23+
run: |
24+
while IFS= read -r lock; do
25+
(cd "$(dirname "$lock")" && npx --yes skills@1 update --project --yes)
26+
done < <(find . -name skills-lock.json -not -path "*/node_modules/*")
27+
- name: Open a pull request with the updates
28+
env:
29+
GH_TOKEN: ${{ github.token }}
30+
run: |
31+
git add -- '*skills-lock.json' '*.agents/skills/*' '*.claude/skills/*'
32+
if git diff --cached --quiet; then exit 0; fi
33+
gh auth setup-git
34+
state="$(gh pr view agent-skills --json state --jq .state 2>/dev/null || true)"
35+
if [ "$state" = "OPEN" ] && git fetch --quiet --depth 2 origin agent-skills && [ "$(git rev-parse FETCH_HEAD^)" = "$(git rev-parse HEAD)" ] && git diff --cached --quiet FETCH_HEAD; then exit 0; fi
36+
git config user.name "github-actions[bot]"
37+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
38+
git switch -C agent-skills
39+
git commit -m "chore: update agent skills"
40+
git push --force origin agent-skills
41+
if [ "$(gh pr view agent-skills --json state --jq .state 2>/dev/null)" != "OPEN" ]; then
42+
gh pr create --head agent-skills --title "chore: update agent skills" --body "Updates the agent skills in \`skills-lock.json\` to the latest versions."
43+
fi

‎README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ Before getting started, make sure you have a development workspace where you hav
1717

1818
Install the [Slack MCP and Skills Plugin](https://docs.slack.dev/ai/slack-skills-plugin/) so your coding agent can create, run, and deploy Slack apps, look up Web API methods and scopes, and build Block Kit without guessing.
1919

20+
`.github/workflows/agent-skills.yml` checks daily for updates to the agent skills in `skills-lock.json` and opens a pull request when they change. To let it open pull requests in your own repository, turn on **Allow GitHub Actions to create and approve pull requests** in **Settings > Actions > General**.
21+
2022
### Claude Code
2123

2224
Run this in a Claude Code session:

0 commit comments

Comments
 (0)