Skip to content

Bump the python-updates group with 3 updates #83

Bump the python-updates group with 3 updates

Bump the python-updates group with 3 updates #83

# Modified from:
# https://docs.github.com/en/code-security/dependabot/working-with-dependabot/automating-dependabot-with-github-actions#approve-a-pull-request
name: Dependabot Auto-Approve PR's
on:
pull_request:
types:
- opened
- reopened
# This is probably not needed, but just in case:
branches:
- main
jobs:
dependabot-automerge:
runs-on: ubuntu-latest
# ONLY run if dependabot opens the PR:
if: github.actor == 'dependabot[bot]'
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GH_TOKEN: ${{ github.token }}
permissions:
# For Approving PR, and Auto-Merging it.
contents: write
pull-requests: write
steps:
### Auto-Merge the PR:
- name: Approve the PR
# https://cli.github.com/manual/gh_pr_review
run: gh pr review "$PR_URL" --approve
- name: Flag PR to auto-merge
# '--auto': Wait for REQUIRED checks to pass still.
# https://cli.github.com/manual/gh_pr_merge
run: gh pr merge "$PR_URL" --auto --merge
env:
## Use a PAT, so merging this will trigger other workflows.
# https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/triggering-a-workflow#triggering-a-workflow-from-a-workflow
# NOTE: Only declared in 'Secrets and Variables - Dependabot'
GH_TOKEN: ${{ secrets.PAT_AUTOMERGE_PR }}
### ONLY on failure:
- name: FAILED - Flag for Review
if: failure()
# https://cli.github.com/manual/gh_pr_edit
run: gh pr edit "$PR_URL" --add-assignee "${{ github.repository_owner }}"