Skip to content

Update stacklok/toolhive to v0.27.2 #4413

Update stacklok/toolhive to v0.27.2

Update stacklok/toolhive to v0.27.2 #4413

Workflow file for this run

name: Claude Code
on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
issues:
types: [opened, assigned]
pull_request_review:
types: [submitted]
jobs:
claude:
# Only run for trusted actors. Fork PRs can modify package.json
# scripts; without this gate, an @claude mention on such a PR
# would execute attacker-controlled code under our secrets and
# write permissions.
if: |
(github.event_name == 'issue_comment' &&
contains(github.event.comment.body, '@claude') &&
contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association)) ||
(github.event_name == 'pull_request_review_comment' &&
contains(github.event.comment.body, '@claude') &&
contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association)) ||
(github.event_name == 'pull_request_review' &&
contains(github.event.review.body, '@claude') &&
contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.review.author_association)) ||
(github.event_name == 'issues' &&
contains(github.event.issue.body, '@claude') &&
contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.issue.author_association))
runs-on: ubuntu-latest
timeout-minutes: 20
permissions:
contents: write
pull-requests: write
issues: write
id-token: write
actions: read # Required for Claude to read CI results on PRs
steps:
# Initial checkout so GitHub Actions can resolve the local
# composite action below. The composite re-checks out the
# repo itself; this first checkout only needs the .github
# directory.
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 1
sparse-checkout: .github
# Checkout + Node + deps so Claude can run build/lint/format
# scripts when asked.
- name: Set up repo and dependencies
uses: ./.github/actions/setup
- name: Run Claude Code
id: claude
uses: anthropics/claude-code-action@476e359e6203e73dad705c8b322e333fabbd7416 # v1
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
additional_permissions: |
actions: read
claude_args: |
--allowed-tools "Bash(npm run build) Bash(npm run prettier) Bash(npm run prettier:fix) Bash(npm run eslint) Bash(npm run eslint:fix)"