Skip to content
Open
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
22 changes: 22 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "daily"
time: "09:00"
timezone: "UTC"
open-pull-requests-limit: 5
commit-message:
prefix: "chore(deps)"
include: "scope"
labels:
- "dependencies"
groups:
development:
patterns:
- "*"
dependency-type: "development"
update-types:
- "minor"
- "patch"
58 changes: 58 additions & 0 deletions .github/workflows/dependabot_automerge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Dependabot Auto-merge

on:
pull_request_target:
types: [opened, synchronize, reopened]

permissions:
contents: write
pull-requests: write

jobs:
auto-merge:
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]'
steps:
- name: Check PR metadata
id: metadata
uses: dependabot/fetch-metadata@v2
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

- name: Determine if auto-merge eligible
id: check-eligibility
run: |
UPDATE_TYPE="${{ steps.metadata.outputs.update-type }}"
echo "Update type: $UPDATE_TYPE"

if [[ "$UPDATE_TYPE" == "version-update:semver-patch" ]] || [[ "$UPDATE_TYPE" == "version-update:semver-minor" ]]; then
echo "eligible=true" >> $GITHUB_OUTPUT
echo "This is a patch or minor update - eligible for auto-merge"
else
echo "eligible=false" >> $GITHUB_OUTPUT
echo "This is a major update - requires manual review"
fi

- name: Approve PR
if: steps.check-eligibility.outputs.eligible == 'true'
run: |
gh pr review "$PR_URL" --approve --body "Auto-approving ${{ steps.metadata.outputs.update-type }} dependency update. This will auto-merge once all checks pass."
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Enable auto-merge
if: steps.check-eligibility.outputs.eligible == 'true'
run: |
gh pr merge "$PR_URL" --auto --squash
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Add manual review comment
if: steps.check-eligibility.outputs.eligible != 'true'
run: |
gh pr comment "$PR_URL" --body "⚠️ This is a **major version update** and requires manual review before merging."
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}