Skip to content

Commit

Permalink
ci: automerge with dependabot
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinBernstorff committed Feb 21, 2024
1 parent 3359265 commit b2e2361
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
15 changes: 15 additions & 0 deletions template/.github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Docs: https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: "pip" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
day: "monday"
time: "13:00"
timezone: "Europe/Copenhagen"
open-pull-requests-limit: 20
commit-message:
prefix: "deps:"
include: "scope"
27 changes: 27 additions & 0 deletions template/.github/workflows/dependabot_automerge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: automerge-bot-prs

on: pull_request

permissions:
contents: write
pull-requests: write

jobs:
dependabot-automerge:
runs-on: ubuntu-latest
# if actor is dependabot or pre-commit-ci[bot] then run
if: ${{ github.actor == 'dependabot[bot]' }}

steps:
# Checkout action is required for token to persist
- name: Enable auto-merge for Dependabot PRs
run: gh pr merge --auto --merge "$PR_URL" # Use Github CLI to merge automatically the PR
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Auto approve dependabot PRs
if: ${{ github.actor == 'dependabot[bot]' }}
uses: hmarr/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit b2e2361

Please sign in to comment.