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
1 change: 1 addition & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# .github/dependabot.yml
version: 2
updates:

Expand Down
22 changes: 18 additions & 4 deletions .github/workflows/dependabot-auto-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,36 @@ permissions:

jobs:
dependabot:
name: Approve & auto-merge Dependabot PRs
runs-on: ubuntu-latest

# Only run for PRs opened by Dependabot
if: github.event.pull_request.user.login == 'dependabot[bot]'

steps:
# 1) Fetch Dependabot metadata (pinned SHA + tag comment for humans/renovators)
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@21025c7d3b7c1eb5122b2f4f30b18d6c8b8c52df # v2.5.0
uses: dependabot/fetch-metadata@21025c7d3b7c1eb5122b2f4f30b18d6c8b8c52df
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
github-token: ${{ secrets.GITHUB_TOKEN }}

# 2) (Optional) Log what’s being updated for troubleshooting
- name: Summarize update
run: |
echo "Dependencies: ${{ steps.metadata.outputs.dependency-names }}"
echo "Update type: ${{ steps.metadata.outputs.update-type }}"

- name: Approve PR
# 3) Approve the PR (required if code owner reviews are enforced)
- name: Approve Dependabot PR
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Enable auto-merge
# 4) Enable auto-merge for safe updates (patch + minor).
# Adjust the condition if you want patch-only or include majors.
- name: Enable auto-merge (patch/minor)
if: |
steps.metadata.outputs.update-type == 'version-update:semver-patch' ||
steps.metadata.outputs.update-type == 'version-update:semver-minor'
Expand Down