Repository navigation
ci: open a pull request when the agent skills update #405
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,43 @@ | ||||||
| name: Update agent skills | ||||||
|
|
||||||
| on: | ||||||
| schedule: | ||||||
| - cron: "0 9 * * *" | ||||||
| workflow_dispatch: | ||||||
|
|
||||||
| jobs: | ||||||
| skills: | ||||||
| runs-on: ubuntu-latest | ||||||
| timeout-minutes: 5 | ||||||
| permissions: | ||||||
| contents: write | ||||||
| pull-requests: write | ||||||
| steps: | ||||||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||||||
| with: | ||||||
| persist-credentials: false | ||||||
| - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 | ||||||
| with: | ||||||
| node-version: 24.x | ||||||
| - name: Update the skills in each skills-lock.json | ||||||
| run: | | ||||||
| while IFS= read -r lock; do | ||||||
| (cd "$(dirname "$lock")" && npx --yes skills@1 update --project --yes) | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📦 issue (blocking):
Suggested change
|
||||||
| done < <(find . -name skills-lock.json -not -path "*/node_modules/*") | ||||||
| - name: Open a pull request with the updates | ||||||
| env: | ||||||
| GH_TOKEN: ${{ github.token }} | ||||||
| run: | | ||||||
| git add -- '*skills-lock.json' '*.agents/skills/*' '*.claude/skills/*' | ||||||
| if git diff --cached --quiet; then exit 0; fi | ||||||
| gh auth setup-git | ||||||
| state="$(gh pr view agent-skills --json state --jq .state 2>/dev/null || true)" | ||||||
| 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 | ||||||
| git config user.name "github-actions[bot]" | ||||||
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||||||
| git switch -C agent-skills | ||||||
| git commit -m "chore: update agent skills" | ||||||
| git push --force origin agent-skills | ||||||
| if [ "$(gh pr view agent-skills --json state --jq .state 2>/dev/null)" != "OPEN" ]; then | ||||||
| gh pr create --head agent-skills --title "chore: update agent skills" --body "Updates the agent skills in \`skills-lock.json\` to the latest versions." | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ✅ issue (blocking): main's ruleset requires the |
||||||
| fi | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯 praise:
persist-credentials: false, withGH_TOKENset only on the last step, keeps the token away from the step that runsnpx.