Skip to content

ci: add Dependabot grouping and auto-merge for patch/minor#40

Open
benhigham wants to merge 3 commits intomainfrom
kael/dependabot-automerge-grouping
Open

ci: add Dependabot grouping and auto-merge for patch/minor#40
benhigham wants to merge 3 commits intomainfrom
kael/dependabot-automerge-grouping

Conversation

@benhigham
Copy link
Owner

Summary

Groups weekly Dependabot PRs and enables auto-merge for patch/minor updates.

Changes

.github/dependabot.yml

  • npm: group all patch/minor updates → 1 PR/week instead of N individual ones
  • GitHub Actions: group all updates → 1 PR/week
  • Major bumps stay as individual PRs (manual review)

.github/workflows/dependabot-auto-merge.yml (new)

  • Calls the shared auto-merge-dependabot workflow from benhigham/.github
  • Approves + squash-merges patch and minor Dependabot PRs automatically
  • Leaves major bumps alone

Result

Weekly maintenance drops from many small PRs to at most 2 (npm batch + actions batch), both auto-merging on schedule.

Raised by Kael 🔗

- Group all npm patch/minor updates into a single weekly PR
- Group all GitHub Actions updates into a single weekly PR
- Major version bumps remain as individual PRs for manual review
- Wire up shared auto-merge workflow from benhigham/.github
Copilot AI review requested due to automatic review settings March 4, 2026 09:18
@changeset-bot
Copy link

changeset-bot bot commented Mar 4, 2026

⚠️ No Changeset found

Latest commit: 266a68f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Dependabot update batching and introduces an automated merge workflow to reduce maintenance overhead from dependency update PRs.

Changes:

  • Groups npm patch/minor Dependabot updates into a single weekly PR.
  • Groups GitHub Actions updates into a single weekly PR.
  • Adds a workflow that calls a shared reusable workflow to auto-approve/merge eligible Dependabot PRs.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
.github/dependabot.yml Adds grouping configuration for npm and GitHub Actions Dependabot updates.
.github/workflows/dependabot-auto-merge.yml Introduces a reusable-workflow-based auto-merge job for Dependabot PRs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

pull_request:

jobs:
auto-merge:
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This workflow doesn’t declare required permissions. By default the GITHUB_TOKEN is read-only in many org/repo setups, so approving/merging may fail. Add explicit minimal permissions (typically pull-requests: write and contents: write) either at the workflow or job level to ensure the reusable workflow can operate.

Suggested change
auto-merge:
auto-merge:
permissions:
contents: write
pull-requests: write

Copilot uses AI. Check for mistakes.
Comment on lines +27 to +30
groups:
github-actions:
patterns:
- '*'
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

github-actions grouping uses patterns: ['*'] without restricting update-types, which will also group major updates. That conflicts with the PR description (“Major bumps stay as individual PRs”). Add update-types: ['minor','patch'] (or otherwise exclude majors) so major GitHub Actions updates remain separate for manual review.

Copilot uses AI. Check for mistakes.
Comment on lines +4 to +7
pull_request:

jobs:
auto-merge:
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The workflow triggers on every pull_request and does not restrict execution to Dependabot PRs. If the called reusable workflow doesn’t hard-guard internally, this could approve/merge non-Dependabot PRs. Add an explicit condition (e.g., if: github.actor == 'dependabot[bot]' / github.event.pull_request.user.login == 'dependabot[bot]') and consider limiting the trigger types to reduce unintended runs.

Suggested change
pull_request:
jobs:
auto-merge:
pull_request:
types: [opened, reopened, synchronize]
jobs:
auto-merge:
if: github.event.pull_request.user.login == 'dependabot[bot]'

Copilot uses AI. Check for mistakes.
Kael (OpenClaw) and others added 2 commits March 4, 2026 09:25
- dependabot.yml: add patterns + update-types to both groups (majors stay individual)
- workflow: add permissions block (contents: write, pull-requests: write)
- workflow: add if: github.actor == 'dependabot[bot]' guard
- workflow: add concurrency block to prevent racing
- workflow: pin reusable workflow to commit SHA instead of @main
- workflow: remove secrets: inherit (GITHUB_TOKEN is implicit)
…ew fixes

Sync changes reviewed and approved in benhigham/prettier-config#40:

- Narrow pull_request trigger to [opened, reopened] only
- Move permissions to job level; set top-level permissions: {}
- Set cancel-in-progress: false (don't cancel in-flight merges)
- Add comment linking to upstream reusable workflow for debugging

Ref: benhigham/prettier-config#40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants