Skip to content

Commit

Permalink
RHCLOUD-31618 Set up dependabot to automatically update container bas…
Browse files Browse the repository at this point in the history
  • Loading branch information
jharting committed May 7, 2024
1 parent a397e7a commit 3877f06
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 2
updates:
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "daily"
groups:
base-image:
dependency-type: "production"
commit-message:
prefix: "[base image] "
27 changes: 27 additions & 0 deletions .github/workflows/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Dependabot base-image auto-merge
on: pull_request

permissions:
contents: write
pull-requests: write

jobs:
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: Print metadata
run: echo "${{ toJSON(steps.metadata.outputs) }}"

- name: Enable auto-merge for Dependabot base image PRs
if: steps.metadata.outputs.package-ecosystem == 'docker' && 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 3877f06

Please sign in to comment.