Skip to content

chore: Bump the all-dependencies group with 14 updates #21

chore: Bump the all-dependencies group with 14 updates

chore: Bump the all-dependencies group with 14 updates #21

name: Dependabot Auto-Merge
on:
pull_request:
types: [opened, synchronize, reopened]
permissions:
contents: write
pull-requests: write
jobs:
dependabot-auto-merge:
name: Auto-merge Dependabot PRs
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]'
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v2
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Enable auto-merge for patch updates
if: |
steps.metadata.outputs.update-type == 'version-update:semver-patch' ||
steps.metadata.outputs.update-type == 'version-update:semver-minor'
run: |
gh pr merge --auto --squash "${{ github.event.pull_request.html_url }}"
echo "✅ Auto-merge enabled for ${{ steps.metadata.outputs.update-type }} update"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Comment on PR
if: |
steps.metadata.outputs.update-type == 'version-update:semver-patch' ||
steps.metadata.outputs.update-type == 'version-update:semver-minor'
uses: actions/github-script@v7
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '🤖 Auto-merge enabled for this ${{ steps.metadata.outputs.update-type }} update. Will merge automatically once CI checks pass.'
})
- name: Approve PR for patch/minor updates
if: |
steps.metadata.outputs.update-type == 'version-update:semver-patch' ||
steps.metadata.outputs.update-type == 'version-update:semver-minor'
run: |
gh pr review --approve "${{ github.event.pull_request.html_url }}"
echo "✅ PR approved"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Add label for major updates
if: steps.metadata.outputs.update-type == 'version-update:semver-major'
uses: actions/github-script@v7
with:
script: |
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ['major-update', 'needs-review']
})
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '⚠️ This is a major version update. Manual review required before merging.'
})