Skip to content

ci: open a pull request when the agent skills update - #63

Merged
mwbrooks merged 1 commit into
mainfrom
mwbrooks-gh-workflow-agent-skills
Nov 19, 2026
Merged

mwbrooks merged 1 commit into
mainfrom
mwbrooks-gh-workflow-agent-skills

Conversation

@mwbrooks

Copy link
Copy Markdown
Member

Summary

This pull request keeps the pre-installed agent skills current for developers who build from this sample, so their coding agent follows the latest Slack guidance without anyone running npx skills update by hand.

  • A daily workflow runs npx skills@1 update --project --yes and opens one chore: update agent skills pull request when the skills change.
  • The workflow commits only .agents/skills, .claude/skills, and skills-lock.json, because skills also writes .grok/ and .kiro/ folders on update.
  • A README line explains the repository setting that lets the workflow open pull requests in an app created from this sample.

Testing

  • After merge, run Update agent skills from the Actions tab and confirm it opens a pull request that updates the skills.
  • Run it again and confirm it leaves that pull request unchanged.

Notes

@mwbrooks mwbrooks added the enhancement New feature or request label Nov 18, 2026
@mwbrooks mwbrooks self-assigned this Nov 18, 2026
@mwbrooks
mwbrooks marked this pull request as ready for review November 18, 2026 23:16
@mwbrooks
mwbrooks requested a review from a team as a code owner November 18, 2026 23:16

@zimeg zimeg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧪 @mwbrooks LGTM! Thanks for keeping the agent skills current in this sample 🎁

@WilliamBergamin WilliamBergamin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙏 @mwbrooks thanks for bringing the skills workflow to the Python search template, and for keeping the token off the update step.
Two blocking comments: update PRs won't get the required CI checks, and skills@1 floats in a job that can write. The loop simplification is optional 🙏

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."

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ issue (blocking): main here requires the test and lint checks from ci.yml, but a PR pushed and opened with the default GITHUB_TOKEN never triggers ci.yml. Each update PR would wait on them until someone re-triggers it. Could we use an app token from actions/create-github-app-token for the push and gh pr create?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: The update PRs do start CI here. GitHub holds the runs as action_required, since github-actions[bot] isn't a collaborator, and MIC approves them before merging. We'll follow up on a way to run them without a manual approval. The pilot's first update PR ran and passed this way: slack-samples/bolt-js-starter-template#190

- 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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📦 issue (blocking): skills@1 floats to every new 1.x and runs in a job that can write. A bad release could drop a .git/hooks file or a $GITHUB_PATH shim that the next step runs with GH_TOKEN. Could we pin an exact version?

Suggested change
(cd "$(dirname "$lock")" && npx --yes skills@1 update --project --yes)
(cd "$(dirname "$lock")" && npx --yes skills@1.9.0 update --project --yes)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: Keeping skills@1 for now, per our DM. The token stays off the npx step, and a pin would mostly add version bumps to chase across 49 samples.

Comment on lines +23 to +26
run: |
while IFS= read -r lock; do
(cd "$(dirname "$lock")" && npx --yes skills@1 update --project --yes)
done < <(find . -name skills-lock.json -not -path "*/node_modules/*")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🪓 suggestion (non-blocking): this repo has one skills-lock.json at the root, so the find loop and glob pathspecs could be a single npx command and git add -- skills-lock.json .agents/skills .claude/skills.

Suggested change
run: |
while IFS= read -r lock; do
(cd "$(dirname "$lock")" && npx --yes skills@1 update --project --yes)
done < <(find . -name skills-lock.json -not -path "*/node_modules/*")
npx --yes skills@1.9.0 update --project --yes

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: I'd like to keep one workflow shape across all 49 samples, so a fix lands the same way everywhere. Here the loop just runs once.

steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯 praise: persist-credentials: false with GH_TOKEN only on the push step keeps the token away from the update step.

@WilliamBergamin WilliamBergamin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ @mwbrooks thanks for the follow-up. The pilot's update PR shows CI does run once its held runs are approved, and keeping skills@1 with the token off the npx step works for us. Nothing blocking now 🚀

@WilliamBergamin
WilliamBergamin dismissed their stale review November 19, 2026 19:07

The blocking concerns are resolved; see the latest review.

@mwbrooks

Copy link
Copy Markdown
Member Author

Thanks @zimeg for the review, and @WilliamBergamin for the careful look at the token and the skills version! 🙇

@mwbrooks
mwbrooks merged commit d72285c into main Nov 19, 2026
8 checks passed
@mwbrooks
mwbrooks deleted the mwbrooks-gh-workflow-agent-skills branch November 19, 2026 23:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants