-
Notifications
You must be signed in to change notification settings - Fork 4
Add Dependabot auto-merge workflow #229
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
base: v0.x.x
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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 a GitHub Actions workflow to automatically approve and merge Dependabot pull requests using a merge commit for clean history.
- Introduces a new workflow file auto-dependabot.yaml.
- Configures a job gated by actor check for dependabot[bot].
- Uses a third-party action to auto-approve and merge PRs with merge-method set to merge.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
jobs: | ||
auto-merge: | ||
if: github.actor == 'dependabot[bot]' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Auto-merge Dependabot PR | ||
uses: ad/dependabot-auto-approve@v1 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
merge-method: 'merge' No newline at end of file |
Copilot
AI
Oct 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The workflow relies on GITHUB_TOKEN to approve and merge, but no explicit permissions block is set; GitHub defaults may be read-only and cause the action to fail. Add a top-level permissions section: permissions: contents: write, pull-requests: write to ensure the action can approve and merge.
Copilot uses AI. Check for mistakes.
- name: Auto-merge Dependabot PR | ||
uses: ad/dependabot-auto-approve@v1 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
merge-method: 'merge' No newline at end of file |
Copilot
AI
Oct 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] This configuration will auto-merge every Dependabot PR regardless of update type (major/minor/patch), which can introduce breaking changes automatically. Consider adding logic (e.g., fetch metadata action + conditional) to restrict merges to patch/minor versions only.
Copilot uses AI. Check for mistakes.
|
||
on: | ||
pull_request: | ||
|
Copilot
AI
Oct 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Triggering on all pull_request event types can create unnecessary workflow runs; specify types (e.g., types: [opened, synchronize, reopened]) to reduce redundant executions.
types: [opened, synchronize, reopened] |
Copilot uses AI. Check for mistakes.
7302d94
to
2798df9
Compare
2798df9
to
e05eeda
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick.
uses: ad/dependabot-auto-approve@v1 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
merge-method: 'merge' No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing EOL.
Signed-off-by: Mathias L. Baumann <[email protected]>
e05eeda
to
7b92c62
Compare
Summary
merge
method for clean commit history