-
Notifications
You must be signed in to change notification settings - Fork 1
Add Claude Code GitHub Actions workflows #41
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
Merged
jnasbyupgrade
merged 6 commits into
Postgres-Extensions:master
from
jnasbyupgrade:add-claude-github-actions
Jul 14, 2026
+127
−0
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
3a6cb68
Add Claude Code GitHub Actions workflows
jnasbyupgrade 7286b3d
ci: review fork PRs via pull_request_target (gated to jnasbyupgrade)
jnasbyupgrade 73691ba
ci: harden claude workflows (CodeRabbit review on #41)
jnasbyupgrade a5dc6d6
ci: track major-version action tags instead of pinned SHAs
jnasbyupgrade 28586d7
ci: drop concurrency limit from the @claude workflow
jnasbyupgrade ec1150d
Prune pgxntool's dev-only dirs from consumers on sync
jnasbyupgrade File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| name: Claude Code Review | ||
|
|
||
| # Runs on PRs INTO this repo. We use pull_request_target (not pull_request) so | ||
| # that PRs from a fork can access CLAUDE_CODE_OAUTH_TOKEN — GitHub withholds | ||
| # secrets from `pull_request` runs triggered by forks, which is why the plain | ||
| # `pull_request` version never worked for fork PRs. | ||
| # | ||
| # SECURITY: pull_request_target runs in the BASE repo with secrets and a | ||
| # write-capable token. The job is gated to PRs from the trusted `jnasbyupgrade` | ||
| # fork only — an arbitrary external fork can never trigger this secret-bearing | ||
| # job. The workflow file always comes from the base branch (master), so a PR | ||
| # cannot modify the reviewer that runs on it. We check out the PR head only for | ||
| # read context (persist-credentials: false) and never build or execute PR code. | ||
| on: | ||
| pull_request_target: | ||
| types: [opened, synchronize, reopened, ready_for_review] | ||
|
|
||
| concurrency: | ||
| group: claude-review-${{ github.event.pull_request.number }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| claude-review: | ||
| # Trusted fork only, and skip drafts (don't spend API/CI on unfinished PRs). | ||
| # To add more trusted owners, extend the head-owner check. | ||
| if: >- | ||
| github.event.pull_request.draft == false && | ||
| github.event.pull_request.head.repo.owner.login == 'jnasbyupgrade' | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 30 | ||
| permissions: | ||
| contents: read | ||
| pull-requests: write # post the review comments | ||
| id-token: write | ||
| steps: | ||
| - name: Check out PR head (read-only context) | ||
| # Intentionally tracks the major-version tag (not a pinned SHA) so | ||
| # upstream fixes are picked up automatically. | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| repository: ${{ github.event.pull_request.head.repo.full_name }} | ||
| ref: ${{ github.event.pull_request.head.sha }} | ||
| fetch-depth: 1 | ||
| persist-credentials: false | ||
|
|
||
| - name: Run Claude Code Review | ||
| uses: anthropics/claude-code-action@v1 | ||
| with: | ||
| claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} | ||
| # NOTE: plugin_marketplaces can't be pinned — it tracks the | ||
| # marketplace repo's default branch (upstream anthropics/claude-code). | ||
| plugin_marketplaces: 'https://github.com/anthropics/claude-code.git' | ||
| plugins: 'code-review@claude-code-plugins' | ||
| prompt: '/code-review:code-review ${{ github.repository }}/pull/${{ github.event.pull_request.number }}' | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| name: Claude Code | ||
|
|
||
| on: | ||
| issue_comment: | ||
| types: [created] | ||
| pull_request_review_comment: | ||
| types: [created] | ||
| issues: | ||
| types: [opened, assigned] | ||
| pull_request_review: | ||
| types: [submitted] | ||
|
jnasbyupgrade marked this conversation as resolved.
|
||
|
|
||
| # No concurrency limit: @claude mentions are independent, read-only requests; | ||
| # serializing would only delay responses and cancelling would drop them. | ||
| jobs: | ||
| claude: | ||
| if: | | ||
| (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) || | ||
| (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) || | ||
| (github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) || | ||
| (github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude'))) | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 30 | ||
| permissions: | ||
| contents: read | ||
| pull-requests: read | ||
| issues: read | ||
| id-token: write | ||
| actions: read # Required for Claude to read CI results on PRs | ||
|
jnasbyupgrade marked this conversation as resolved.
|
||
| steps: | ||
| - name: Checkout repository | ||
| # Intentionally tracks the major-version tag (not a pinned SHA) so | ||
| # upstream fixes are picked up automatically. | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 1 | ||
| persist-credentials: false | ||
|
|
||
| - name: Run Claude Code | ||
| id: claude | ||
| uses: anthropics/claude-code-action@v1 | ||
| with: | ||
| claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} | ||
| # Allows Claude to read CI results on PRs | ||
| additional_permissions: | | ||
| actions: read | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.