Slackbot
05/11/2023, 11:03 AMLiora Milbaum
05/13/2023, 9:50 AMPhillip Verheyden
05/17/2023, 2:56 PMbut the volume of updates is hard to keep up withanother strategy could be to tone down the frequency of updates, for instance only have dependabot check for updates once a week
Phillip Verheyden
05/17/2023, 2:58 PMname: Dependabot auto-approve
on: pull_request_target
permissions:
pull-requests: write
# From the docs at <https://github.com/dependabot/fetch-metadata#enabling-auto-merge>
jobs:
dependabot:
runs-on: ubuntu-latest
if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' }}
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v1.3.0
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Auto-approve minor or patch updates
if: |
steps.metadata.outputs.update-type == 'version-update:semver-minor'
|| steps.metadata.outputs.update-type == 'version-update:semver-patch'
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
and then we also flip on ‘auto-squash-merge’ (which you have to enable at the repo level I believe) for all dependabot PRs once they are approved
name: Dependabot auto-merge
on: pull_request
permissions:
pull-requests: write
contents: write
# Mostly from <https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/automating-dependabot-with-github-actions#enable-auto-merge-on-a-pull-request>
jobs:
dependabot:
runs-on: ubuntu-latest
if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' }}
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v1.3.0
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Enable auto-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}}
Kyle Campbell
05/17/2023, 4:31 PMLiora Milbaum
05/17/2023, 7:45 PMJim Park
05/19/2023, 8:31 PMMichel Loiseleur
05/23/2023, 6:48 AM