Skip to content

chore(deps): bump dependabot/fetch-metadata from 2.3.0 to 3.1.0 #27

chore(deps): bump dependabot/fetch-metadata from 2.3.0 to 3.1.0

chore(deps): bump dependabot/fetch-metadata from 2.3.0 to 3.1.0 #27

name: Dependabot auto-merge
on:
pull_request_target:
types: [opened, synchronize, reopened, ready_for_review]
permissions:
contents: write
pull-requests: write
concurrency:
group: dependabot-auto-merge-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
enable-auto-merge:
if: github.event.pull_request.user.login == 'dependabot[bot]' && github.event.pull_request.head.repo.full_name == github.repository && github.event.pull_request.base.ref == github.event.repository.default_branch && github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- name: Read Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@25dd0e34f4fe68f24cc83900b1fe3fe149efef98
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Approve and enable auto-merge for minor and patch updates
id: auto_merge
if: steps.metadata.outputs.update-type == 'version-update:semver-minor' || steps.metadata.outputs.update-type == 'version-update:semver-patch'
continue-on-error: true
run: |
gh pr review --approve "$PR_URL"
gh pr merge --auto --squash --match-head-commit "$PR_HEAD_SHA" "$PR_URL"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
PR_URL: ${{ github.event.pull_request.html_url }}
- name: Request manual review when auto-merge is unavailable
if: always() && steps.auto_merge.outcome != 'success'
run: gh pr edit --add-reviewer "$REVIEWER" "$PR_URL"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_URL: ${{ github.event.pull_request.html_url }}
REVIEWER: ${{ github.repository_owner }}