Skip to content

Conversation

simongdavies
Copy link
Contributor

This PR automates the process of approval and merging of dependabot PRs and does it at a time when there should be less merging of "real" PRs taking place.

It does the following:

Sets the dependabot job to run at 03:00 UTC daily.

Runs a new job at 04:00 UTC daily which checks for any open PRs, for any PR that all of the following conditions are true:

  1. Authored by dependabot
  2. That the PR only modifies Cargo.lock/Cargo.toml files or GH actions workflows.
  3. No status checks have failed.
  4. That no one other than dependabot has authored any commits in the PR

The job will then set auto approve squash property on the PR (dependabot commands are not used as they need to be issued by a real user). These changes are made by an app as this means that as they show up as dependabot-pr-auto-approver) , additionally the app token is limited to the permissions required by this job and cannot obtain any other permissions unless the app is updated.

@simongdavies simongdavies force-pushed the auto-approve-dependabot branch from f9103b1 to 9f153b9 Compare May 15, 2025 08:22
@simongdavies simongdavies merged commit fce172e into main May 15, 2025
25 checks passed
@simongdavies simongdavies deleted the auto-approve-dependabot branch May 15, 2025 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants