Skip to content

fix: Use ubuntu-latest for dependabot workflow security #14

fix: Use ubuntu-latest for dependabot workflow security

fix: Use ubuntu-latest for dependabot workflow security #14

name: Dependabot auto-approve and auto-merge
on:
pull_request_target:
types: [opened, synchronize, reopened]
permissions:
pull-requests: write
contents: write
jobs:
dependabot:
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]'
steps:
- name: Checkout Repo
uses: actions/checkout@v6
with:
fetch-depth: 1
- name: Install GitHub CLI
run: |
sudo apt-get update
sudo apt-get install -y gh
- name: Authenticate gh
run: echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token
- name: Approve dependabot PRs
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Merge for dependabot PRs
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}