Skip to content

Instantly share code, notes, and snippets.

@kwilczynski
Created December 17, 2022 21:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kwilczynski/0209b52a5a067cddaece09f585939c12 to your computer and use it in GitHub Desktop.
Save kwilczynski/0209b52a5a067cddaece09f585939c12 to your computer and use it in GitHub Desktop.
name: "Auto-merge Dependabot Pull Request for Dockerfile updates"
permissions:
pull-requests: write
contents: write
on:
pull_request_target:
branches:
- main
types:
- labeled
jobs:
automerge:
runs-on: ubuntu-latest
if: |
github.actor == 'dependabot[bot]'
&& github.ref == 'refs/heads/main'
&& startsWith(github.head_ref, 'dependabot/docker/')
steps:
- name: "Fetch Dependabot metadata"
id: dependabot-metadata
uses: dependabot/fetch-metadata@v1
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: "Auto-merge Dependabot Pull Request"
if: |
contains(steps.dependabot-metadata.outputs.dependency-names, 'ubi')
run: gh pr merge --auto --merge "${PR_URL}"
env:
PR_URL: "${{ github.event.pull_request.html_url }}"
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
version: 2
updates:
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "daily"
time: "05:00"
timezone: "Asia/Tokyo"
target-branch: "main"
labels:
- "dependencies"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment