-
Notifications
You must be signed in to change notification settings - Fork 0
Automate dependency monitoring and patch-level auto-merge #16
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
5 commits
Select commit
Hold shift + click to select a range
f71a07f
github: monitor Go module dependencies with Dependabot
danielorbach 7b39b43
github: monitor GitHub Actions dependencies with Dependabot
danielorbach 5bafdd7
github: auto-merge Dependabot patch updates after CI passes
danielorbach fd0132f
github: document deferred LLM review for minor and major updates
danielorbach 0393e02
github: restrict automerge workflow to the default branch
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,24 @@ | ||
| # Dependabot Configuration | ||
| # | ||
| # Weekly update checks balance responsiveness with notification fatigue. | ||
| # Patch updates auto-merge via dependabot-automerge workflow. | ||
|
|
||
| version: 2 | ||
| updates: | ||
| - package-ecosystem: gomod | ||
| directory: / | ||
| schedule: | ||
| interval: weekly | ||
| commit-message: | ||
| prefix: "go.mod" | ||
| labels: | ||
| - dependencies | ||
|
|
||
| - package-ecosystem: github-actions | ||
| directory: / | ||
| schedule: | ||
| interval: weekly | ||
| commit-message: | ||
| prefix: "github" | ||
| labels: | ||
| - dependencies |
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,67 @@ | ||
| # Dependabot Auto-merge Workflow | ||
| # | ||
| # Patch updates auto-merge after CI passes. Minor and major updates | ||
| # require human review until LLM-assisted review is available (#5). | ||
| # | ||
| # Squash commits default to using the PR description as body, but | ||
| # Dependabot PRs include lengthy changelogs and compatibility notes. | ||
| # The merge step overrides the body to keep commit messages clean. | ||
|
|
||
| name: "🤖 Dependabot" | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [main] | ||
| # Path filter avoids creating workflow runs for unrelated PRs while | ||
| # still catching all Dependabot updates (Go modules and Actions). | ||
| paths: | ||
| - "go.mod" | ||
| - "go.sum" | ||
| - ".github/workflows/**" | ||
|
|
||
| permissions: | ||
| contents: write # Required by: gh pr merge --auto | ||
| pull-requests: write # Required by: gh pr review --approve | ||
|
|
||
| jobs: | ||
| automerge: | ||
| name: Review & Merge | ||
| runs-on: ubuntu-latest | ||
| if: github.actor == 'dependabot[bot]' | ||
| 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 }} | ||
|
|
||
| # TODO(#5): Review minor updates with Claude before auto-merging. | ||
| # Once the Claude Code workflow lands, add a step here that uses | ||
| # claude-code-action to review the diff and approve if acceptable, | ||
| # followed by an auto-merge step gated on the same condition. | ||
|
|
||
| # TODO(#5): Analyze major updates with Claude, require human merge. | ||
| # Major updates may contain breaking changes. The planned step uses | ||
| # claude-code-action to post a review comment with migration notes | ||
| # and risk analysis, but does not approve or merge. A human reads | ||
| # the analysis and decides whether to proceed. | ||
|
|
||
| - 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 }}% | ||
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.