Skip to content

Commit

Permalink
feat: add dependabot auto-merge on PRs
Browse files Browse the repository at this point in the history
There's an issue that will occur if we do not maintain the very tip of the runner execution script, they become deprecated after a month. We need to auto-merge these so clusters consuming this image will not cease to function when inevitably they do deprecate the source image.
  • Loading branch information
dragonfleas committed Jul 12, 2024
1 parent 094b0b3 commit b4ad27c
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on:
branches:
- main

permissions:
contents: write
pull-requests: write

jobs:
create_matrix:
uses: ./.github/workflows/create_matrix.yml
Expand Down Expand Up @@ -48,3 +52,19 @@ jobs:

- name: Check build status
run: docker run --rm localhost:5000/${{ steps.set_image_name.outputs.image_name }}:latest

dependabot:
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]'
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v2
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Enable auto-merge for Dependabot PRs
if: contains(steps.metadata.outputs.dependency-names, 'my-dependency') && steps.metadata.outputs.update-type == 'version-update:semver-patch'
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit b4ad27c

Please sign in to comment.