Skip to content

new sources, pins removed, three source fixes, npm apisurface (#226, #232, #240, #244) #261

new sources, pins removed, three source fixes, npm apisurface (#226, #232, #240, #244)

new sources, pins removed, three source fixes, npm apisurface (#226, #232, #240, #244) #261

Workflow file for this run

# Claude on demand: a maintainer mentions @claude in a PR comment, a review or a
# review comment, and Claude replies in the same thread. `@claude review` on a
# PR gets a full review against this repo's rules, including PRs from forks.
#
# This repo is public, so this workflow is locked down:
# - Only maintainers trigger it: the commenter's author_association must be
# OWNER, MEMBER or COLLABORATOR, or no runner starts. The action then checks
# write access itself. Bots can't trigger it.
# - Read and comment only. Claude can read the repo and the PR, and reply; it
# can't edit files, commit, push, run commands or fetch web pages
# (`--permission-mode default`, so anything not allowed below is denied).
# - On a fork's PR the action checks out the fork's code to read, but restores
# Claude's config (CLAUDE.md, AGENTS.md, .claude/) from main, and Claude runs
# none of the fork's code. Never uses `pull_request_target`.
#
# Auth: CLAUDE_CODE_OAUTH_TOKEN, same as claude-code-review.yml.
name: Claude
on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
pull_request_review:
types: [submitted]
jobs:
claude:
# Only a maintainer's comment that mentions @claude starts a runner.
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))
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: read
pull-requests: write # replies and inline comments
issues: write # PR comments go through the issues API
id-token: write # the action authenticates as the Claude GitHub App
actions: read # lets Claude read CI results on PRs
env:
HAS_TOKEN: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN != '' }}
steps:
- name: Skip (CLAUDE_CODE_OAUTH_TOKEN not set)
if: env.HAS_TOKEN != 'true'
run: echo "::notice::CLAUDE_CODE_OAUTH_TOKEN is not set; skipping Claude."
# The base branch. The action itself checks out the PR's code to read.
- uses: actions/checkout@v6
if: env.HAS_TOKEN == 'true'
with:
fetch-depth: 1
- uses: anthropics/claude-code-action@v1
if: env.HAS_TOKEN == 'true'
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
# Public repo: the run summary is public, so don't print Claude's report there.
display_report: false
# Read-only plus commenting. No Bash beyond reading the PR and issues,
# no edits, no commits or pushes, no web.
claude_args: >-
--model claude-opus-5-5
--permission-mode default
--allowedTools "mcp__github_inline_comment__create_inline_comment,Read,Grep,Glob,Bash(gh pr view:*),Bash(gh pr diff:*),Bash(gh issue view:*)"
--disallowedTools "Edit,Write,MultiEdit,NotebookEdit,WebFetch,WebSearch,Bash(git push:*),Bash(git commit:*),Bash(git add:*),Bash(git rm:*),mcp__github_file_ops__commit_files,mcp__github_file_ops__delete_files"
--append-system-prompt "This is patch-it-plugins, a public repo of source plugins. Everything you write is public. You can only read and comment; you can't change files or run code, so if asked to, say so and describe the change instead. When asked to review a pull request (for example '@claude review'), check it against AGENTS.md: (1) every new or changed source is registered with plugin.RegisterProvider with complete, accurate metadata (provider id, name, category, homepage; source id, layer, what it watches, URLs, page), and no hand-kept list of plugins comes back; (2) every new provider has providers/<api>.md from providers/_template.md with a real 'Why this source' (link, date checked, why it's best, alternatives, quote); (3) a golden test over a real saved source, a testdata/README.md row (URL, date fetched, license, quote), one pinned drop test, every event carries its source URL and a quote, and golden edits are explained; (4) fetch only through env.Get or core/kit/, no net/http outside core/fetch/, core/kit/ and plugins/openapi/adapter/, no filesystem outside testdata/; (5) precision over recall: flag anything that could emit an event for a non-change; (6) nothing private: no credentials, internal hostnames or service names, links to private repos or tickets, customer names, or links to AI sessions. You can't run the tests; say that CI_go covers them. Start with one verdict line ('✅ Ready to merge', '⚠️ Merge after fixes' or '❌ Not ready'), then a table of rule | status | evidence, blocking bugs, and clearly marked non-blocking suggestions. Be kind and specific: many authors are outside contributors. Never include a Claude session ID or claude.ai link."