-
Notifications
You must be signed in to change notification settings - Fork 0
Review Dependabot minor and major updates with Claude Code #19
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
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
187c012
github: review Dependabot minor updates with Claude Code
danielorbach 7e08be1
github: analyze Dependabot major updates with Claude Code
danielorbach b7ca5ee
github: configure tool permissions and Dependabot integration
danielorbach 73d7b47
github: enable auto-merge for Claude-reviewed minor updates
danielorbach 1150636
github: document tiered Dependabot review workflow
danielorbach cf86cce
github: document why commit signing is disabled for Dependabot reviews
danielorbach 3cd2d34
github: check out repository for Claude dependency reviews
danielorbach 2777385
github: allow Go and read-safe gh commands in Dependabot reviews
danielorbach 0481313
github: warn Claude about v0.x semver semantics in minor reviews
danielorbach a92e68d
github: split review and merge into separate jobs
danielorbach 24105da
github: extend auto-merge to major updates
danielorbach eabcedd
github: add Auto-merged-by trailer to squash commit bodies
danielorbach 29c9f77
github: use slim runner for merge job
danielorbach 3d0e2f7
github: rename workflow to claudependabot
danielorbach 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
Some comments aren't visible on the classic Files Changed page.
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,192 @@ | ||
| # Dependabot Auto-merge Workflow | ||
| # | ||
| # All bump levels enable auto-merge; major updates require human approval: | ||
| # - Patch: auto-approved (low-risk) | ||
| # - Minor: Claude reviews, approves if acceptable | ||
| # - Major: Claude advises, human must approve; merge job cleans up the commit | ||
| # | ||
| # ┌────────────────────────────┬───────────────┐ | ||
| # │ Review │ Merge │ | ||
| # ├────────────────────────────┼───────────────┤ | ||
| # patch ────┤ approve ─────────────────┐ │ │ | ||
| # minor ────┤ Claude review ── approve ┼─┼─ squash-merge │ | ||
| # major ────┤ Claude analysis ── human ┘ │ │ | ||
| # └────────────────────────────┴───────────────┘ | ||
| # | ||
| # Squash commits default to using the PR description as body, but Dependabot | ||
| # PRs include lengthy changelogs and compatibility notes. Each step overrides | ||
| # the body to keep commit messages clean. | ||
|
|
||
| name: "🤖 ClauDependabot" | ||
|
|
||
| on: | ||
| # Using pull_request (not pull_request_target) because the OIDC approach for | ||
| # GitHub app impersonation does not appear to work with Dependabot PRs. | ||
| # See: https://github.com/anthropics/claude-code-action/issues/713 | ||
| # | ||
| # This means Claude jobs will fail if Dependabot updates this file itself, | ||
| # but we've minimized actions here to reduce that risk. | ||
| pull_request: | ||
| # Path filter avoids creating workflow runs for unrelated PRs while still | ||
| # catching all Dependabot updates (Go modules and GitHub Actions). | ||
| paths: | ||
| - "go.mod" | ||
| - "go.sum" | ||
| - ".github/workflows/**" | ||
|
|
||
| jobs: | ||
| review: | ||
| name: Review | ||
| runs-on: ubuntu-latest | ||
| if: github.actor == 'dependabot[bot]' | ||
| permissions: | ||
| pull-requests: write # Required by: gh pr review --approve | ||
| id-token: write # Required for Claude to generate GitHub app tokens | ||
| contents: read # Required by: actions/checkout | ||
| steps: | ||
| - name: Fetch Dependabot metadata | ||
| id: metadata | ||
| uses: dependabot/fetch-metadata@v2 | ||
| with: | ||
| github-token: "${{ secrets.GITHUB_TOKEN }}" | ||
| compat-lookup: true | ||
|
|
||
| - name: Approve patch | ||
| if: steps.metadata.outputs.update-type == 'version-update:semver-patch' | ||
| run: gh pr review --approve -b "Patch update — auto-approved" "$PR_URL" | ||
| env: | ||
| PR_URL: ${{ github.event.pull_request.html_url }} | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Checkout for review | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| # The review job grants no write scopes to contents, but | ||
| # persist-credentials: false ensures the Claude agent cannot | ||
| # use the automatic GITHUB_TOKEN to push even if permissions | ||
| # change later. | ||
| persist-credentials: false | ||
danielorbach marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| - name: Review minor | ||
| if: steps.metadata.outputs.update-type == 'version-update:semver-minor' | ||
| uses: anthropics/claude-code-action@v1 | ||
|
||
| with: | ||
| anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} | ||
| allowed_bots: dependabot | ||
| prompt: | | ||
| This is a Dependabot PR for a minor version update. | ||
|
|
||
| Package ecosystem: ${{ steps.metadata.outputs.package-ecosystem }} | ||
| Dependency: ${{ steps.metadata.outputs.dependency-names }} | ||
| Update: ${{ steps.metadata.outputs.previous-version }} → ${{ steps.metadata.outputs.new-version }} | ||
| PR: ${{ github.event.pull_request.html_url }} | ||
|
|
||
| Use `gh pr diff` and `gh pr view` to review the changes. | ||
|
|
||
| Minor updates should be backwards-compatible. However, for v0.x | ||
| dependencies, minor bumps may contain breaking changes per semver. | ||
| Review those with extra caution. | ||
|
|
||
| If the changes look reasonable, approve the PR with a message that | ||
| includes your model identifier (e.g. "Reviewed by claude-sonnet-4-20250514"). | ||
|
|
||
| Use: gh pr review --approve --body "your message" | ||
| claude_args: | | ||
| --allowedTools "Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr review:*)" | ||
| --allowedTools "Bash(gh issue:*),Bash(gh search:*),Bash(gh run:*),Bash(gh workflow:*),Bash(gh release:*)" | ||
| --allowedTools "Bash(go:*),WebFetch,WebSearch" | ||
| --max-turns 25 | ||
|
|
||
| - name: Review major | ||
| if: steps.metadata.outputs.update-type == 'version-update:semver-major' | ||
| uses: anthropics/claude-code-action@v1 | ||
|
||
| with: | ||
| anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} | ||
| allowed_bots: dependabot | ||
| prompt: | | ||
| This is a Dependabot PR for a MAJOR version update. | ||
|
|
||
| Package ecosystem: ${{ steps.metadata.outputs.package-ecosystem }} | ||
| Dependency: ${{ steps.metadata.outputs.dependency-names }} | ||
| Update: ${{ steps.metadata.outputs.previous-version }} → ${{ steps.metadata.outputs.new-version }} | ||
| PR: ${{ github.event.pull_request.html_url }} | ||
|
|
||
| Use `gh pr diff` and `gh pr view` to review the changes. | ||
|
|
||
| Major updates may have breaking changes. Please: | ||
|
|
||
| 1. Fetch the dependency's release page and CHANGELOG to understand what changed | ||
| 2. Check the README for migration guides | ||
| 3. Review the codebase for usages of this dependency | ||
| 4. If changes are needed, comment on the PR with suggested fixes | ||
|
|
||
| For github_actions ecosystem specifically: | ||
| - Review the workflow files in .github/workflows/ that use this action | ||
| - Check for deprecated inputs, outputs, or runner requirements | ||
|
|
||
| Do NOT approve, merge, or push commits to this PR. | ||
| Use `gh pr review --comment` to post your analysis and any suggested code changes. | ||
| IMPORTANT: Place all parameters AFTER --comment (e.g., `gh pr review --comment --body "..." <PR_URL>`). | ||
| claude_args: | | ||
| --allowedTools "Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr review --comment:*),Bash(gh pr review -c:*)" | ||
| --allowedTools "Bash(gh issue:*),Bash(gh search:*),Bash(gh run:*),Bash(gh workflow:*),Bash(gh release:*)" | ||
| --allowedTools "Bash(go:*),WebFetch,WebSearch" | ||
| --disallowedTools "Bash(gh pr review --approve:*),Bash(gh pr review -a:*)" | ||
| --max-turns 50 | ||
|
|
||
| merge: | ||
| name: Merge | ||
| runs-on: ubuntu-slim | ||
| needs: review | ||
| if: github.actor == 'dependabot[bot]' | ||
| permissions: | ||
| contents: write # Required by: gh pr merge --auto | ||
| pull-requests: write # Required by: gh pr merge --auto | ||
| steps: | ||
| - name: Fetch Dependabot metadata | ||
| id: metadata | ||
| uses: dependabot/fetch-metadata@v2 | ||
|
||
| with: | ||
| github-token: "${{ secrets.GITHUB_TOKEN }}" | ||
| compat-lookup: true | ||
|
|
||
| - name: Auto-merge patch | ||
| if: steps.metadata.outputs.update-type == 'version-update:semver-patch' | ||
| run: gh pr merge --auto --squash "$PR_URL" --body "$BODY" | ||
| env: | ||
| PR_URL: ${{ github.event.pull_request.html_url }} | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| BODY: | | ||
| This patch update was merged automatically since patch-level | ||
| changes carry minimal risk of breaking existing functionality. | ||
|
|
||
| Compatibility score: ${{ steps.metadata.outputs.compatibility-score }}% | ||
|
|
||
| Auto-merged-by: ClauDependabot | ||
|
|
||
| - name: Auto-merge minor | ||
| if: steps.metadata.outputs.update-type == 'version-update:semver-minor' | ||
| run: gh pr merge --auto --squash "$PR_URL" --body "$BODY" | ||
| env: | ||
| PR_URL: ${{ github.event.pull_request.html_url }} | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| BODY: | | ||
| This minor update was reviewed by Claude before merging. | ||
|
|
||
| Compatibility score: ${{ steps.metadata.outputs.compatibility-score }}% | ||
|
|
||
| Auto-merged-by: ClauDependabot | ||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| - name: Auto-merge major | ||
| if: steps.metadata.outputs.update-type == 'version-update:semver-major' | ||
| run: gh pr merge --auto --squash "$PR_URL" --body "$BODY" | ||
| env: | ||
| PR_URL: ${{ github.event.pull_request.html_url }} | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| BODY: | | ||
| This major update was reviewed by Claude and approved by a human | ||
| before merging. | ||
|
|
||
| Compatibility score: ${{ steps.metadata.outputs.compatibility-score }}% | ||
|
|
||
| Auto-merged-by: ClauDependabot | ||
This file was deleted.
Oops, something went wrong.
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.