Skip to content

chore: bump zgosalvez/github-actions-ensure-sha-pinned-actions from 3.0.14 to 3.0.15 #187

chore: bump zgosalvez/github-actions-ensure-sha-pinned-actions from 3.0.14 to 3.0.15

chore: bump zgosalvez/github-actions-ensure-sha-pinned-actions from 3.0.14 to 3.0.15 #187

name: Dependabot pull request approve and merge
on: pull_request_target
# Declare default permissions as read only.
permissions: read-all
jobs:
dependabot:
name: Dependabot
permissions:
actions: write
contents: write
issues: write
pull-requests: write
repository-projects: write
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Dependabot metadata
id: dependabot-metadata
uses: dependabot/fetch-metadata@c9c4182bf1b97f5224aee3906fd373f6b61b4526 # v1.6.0
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Approve a PR
if: ${{ steps.dependabot-metadata.outputs.update-type != 'version-update:semver-major' }}
run: |
gh pr review --approve "${PR_URL}"
gh pr edit "${PR_URL}" --add-label "dependabot: auto approve"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Auto-merge non major updates
if: ${{ steps.dependabot-metadata.outputs.update-type != 'version-update:semver-major' }}
run: |
gh pr merge --auto --squash "${PR_URL}"
gh pr edit "${PR_URL}" --add-label "dependabot: auto merge"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Comment + label major updates
if: ${{ steps.dependabot-metadata.outputs.update-type == 'version-update:semver-major' }}
run: |
gh pr comment "${PR_URL}" --body "I'm **not approving** this PR because **it includes a major update of a dependency**"
gh pr edit "${PR_URL}" --add-label "dependabot: manual approve"
gh pr edit "${PR_URL}" --add-label "dependabot: manual merge"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}