Skip to content

Commit

Permalink
Set up Dependabot with auto-merge
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromegamez committed Nov 27, 2023
1 parent 383934b commit ea7d516
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2

updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
commit-message:
include: "scope"
prefix: "github-actions"
open-pull-requests-limit: 10
labels:
- "dependency"
23 changes: 23 additions & 0 deletions .github/workflows/dependabot-auto-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: "Dependabot auto-merge"

on: [pull_request_target] # yamllint disable-line rule:truthy

permissions:
contents: "write"

jobs:
dependabot:
runs-on: "ubuntu-latest"
if: "${{ github.actor == 'dependabot[bot]' }}"
steps:
- name: "Dependabot metadata"
id: "metadata"
uses: "dependabot/[email protected]"
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: "Enable auto-merge for Dependabot PRs"
if: "${{ steps.dependabot-metadata.outputs.update-type != 'version-update:semver-major' }}"
run: "gh pr merge --auto --merge \"$PR_URL\""
env:
PR_URL: "${{github.event.pull_request.html_url}}"
GITHUB_TOKEN: "${{secrets.GITHUB_TOKEN}}"

0 comments on commit ea7d516

Please sign in to comment.