Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Dependency updates.
#
# Grouped on purpose: one pull request per ecosystem per week, rather than one
# per package. A single package's CVE list can otherwise open dozens of pull
# requests in a morning. Security updates still arrive immediately, outside
# this schedule, because Dependabot handles those separately.
version: 2
updates:
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
open-pull-requests-limit: 5
groups:
routine:
update-types: ["patch", "minor"]
commit-message:
prefix: "chore(deps)"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
groups:
routine:
update-types: ["patch", "minor", "major"]
commit-message:
prefix: "ci(deps)"
38 changes: 38 additions & 0 deletions .github/workflows/dependabot-auto.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Routine dependency pull requests merge on their own once CI passes.
#
# Scope, stated plainly: a pull request opened by Dependabot whose update type
# is patch or minor merges without a human reading it, after every required
# check has passed. CI is the evidence for those merges. Major bumps get a
# comment and wait for a maintainer.
name: dependabot-auto

on: pull_request_target

permissions:
contents: write
pull-requests: write

jobs:
auto:
if: github.actor == 'dependabot[bot]'
runs-on: ubuntu-latest
steps:
- name: read the update type
id: meta
uses: dependabot/fetch-metadata@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: enable auto-merge for patch and minor
if: contains(fromJSON('["version-update:semver-patch","version-update:semver-minor"]'), steps.meta.outputs.update-type)
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh pr merge --auto --squash "${{ github.event.pull_request.html_url }}"

- name: leave a major bump for a maintainer
if: steps.meta.outputs.update-type == 'version-update:semver-major'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr comment "${{ github.event.pull_request.html_url }}" \
--body "Major version bump, so this one waits for a maintainer."