Skip to content

chore: automerge Dependabot PRs on passing checks - #39

Merged
don-petry merged 3 commits into
mainfrom
copilot/enable-automerge-dependabot-prs
Mar 11, 2026
Merged

chore: automerge Dependabot PRs on passing checks#39
don-petry merged 3 commits into
mainfrom
copilot/enable-automerge-dependabot-prs

Conversation

Copilot AI commented Mar 8, 2026

Copy link
Copy Markdown
Contributor
  • Explore repo structure and existing workflows
  • Create .github/dependabot.yml to enable weekly Dependabot updates for npm and GitHub Actions
  • Create .github/workflows/dependabot-automerge.yml workflow to auto-merge Dependabot PRs when all checks pass
  • Run code review and security checks
  • Apply prettier formatting
Original prompt

This section details on the original issue you should resolve

<issue_title>Automerge Dependabot PRs</issue_title>
<issue_description>When dependabot opens a PR which passes all checks it should be merged automatically. This removes an unnecessary human review and ensure updates happen rapidly. </issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: don-petry <36422719+don-petry@users.noreply.github.com>
Copilot AI changed the title [WIP] Enable automatic merging of Dependabot PRs chore: automerge Dependabot PRs on passing checks Mar 8, 2026
@don-petry

Copy link
Copy Markdown
Collaborator

@copilot - apply prettier. Always apply prettier on every commit.

Co-authored-by: don-petry <36422719+don-petry@users.noreply.github.com>

Copilot AI commented Mar 8, 2026

Copy link
Copy Markdown
Contributor Author

@copilot - apply prettier. Always apply prettier on every commit.

Applied prettier in b4504b1 — single quotes replacing double quotes in dependabot.yml (the automerge workflow was already formatted correctly).

@don-petry
don-petry marked this pull request as ready for review March 11, 2026 21:52
Copilot AI review requested due to automatic review settings March 11, 2026 21:52
@don-petry
don-petry merged commit eae57cc into main Mar 11, 2026
9 checks passed
@don-petry
don-petry deleted the copilot/enable-automerge-dependabot-prs branch March 11, 2026 21:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 configuration and a GitHub Actions workflow to automatically enable auto-merge for eligible Dependabot PRs, supporting faster dependency hygiene for this repo.

Changes:

  • Add .github/dependabot.yml to enable weekly updates for npm and GitHub Actions.
  • Add a Dependabot auto-merge workflow that enables auto-merge for semver patch/minor Dependabot PRs via gh pr merge --auto.

Reviewed changes

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

File Description
.github/workflows/dependabot-automerge.yml Enables auto-merge for Dependabot PRs (patch/minor) using fetch-metadata + gh pr merge --auto.
.github/dependabot.yml Configures weekly Dependabot updates for npm and GitHub Actions.

Comment on lines +6 to +11
contents: write
pull-requests: write

jobs:
dependabot:
runs-on: ubuntu-latest

Copilot AI Mar 11, 2026

Copy link

Choose a reason for hiding this comment

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

permissions are set to contents: write and pull-requests: write at the workflow level, which grants a write-scoped GITHUB_TOKEN for every PR event (even though the job later gates on github.actor). To follow least-privilege, set the workflow-level permissions to read-only (or omit them) and move the write permissions down to the jobs.dependabot.permissions (or the specific step) so they’re only granted when needed.

Suggested change
contents: write
pull-requests: write
jobs:
dependabot:
runs-on: ubuntu-latest
contents: read
pull-requests: read
jobs:
dependabot:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,23 @@
name: Dependabot auto-merge

on: pull_request

Copilot AI Mar 11, 2026

Copy link

Choose a reason for hiding this comment

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

This workflow triggers on every pull_request to any branch. Other workflows in this repo scope PR workflows to main; consider switching to on: pull_request: branches: [main] (and using the expanded on: mapping style) to avoid unnecessary runs and keep workflow triggers consistent across the repo.

Suggested change
on: pull_request
on:
pull_request:
branches:
- main

Copilot uses AI. Check for mistakes.
Copilot AI added a commit that referenced this pull request Mar 11, 2026
Co-authored-by: don-petry <36422719+don-petry@users.noreply.github.com>
don-petry added a commit that referenced this pull request Mar 11, 2026
…bot-automerge workflow (#48)

* Initial plan

* fix: address PR #39 review comments on dependabot-automerge workflow

Co-authored-by: don-petry <36422719+don-petry@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: don-petry <36422719+don-petry@users.noreply.github.com>
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.

Automerge Dependabot PRs

3 participants