diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..4caad1b9 --- /dev/null +++ b/.github/dependabot.yml @@ -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] " diff --git a/.github/workflows/dependabot.yml b/.github/workflows/dependabot.yml new file mode 100644 index 00000000..a081e220 --- /dev/null +++ b/.github/workflows/dependabot.yml @@ -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}} \ No newline at end of file