Auto-merge minor updates 🎸

This commit is contained in:
Jan Raasch 2024-02-20 16:07:38 +01:00
parent fab37cf385
commit 139ff34809

View File

@ -1,3 +1,5 @@
# see https://gist.github.com/xt0rted/46475099dc0a70ba63e16e3177407872
name: Dependabot auto-merge name: Dependabot auto-merge
on: on:
@ -6,23 +8,34 @@ on:
- master - master
permissions: permissions:
issues: write contents: read
contents: write pull-requests: read
pull-requests: write
jobs: jobs:
auto-merge: auto-merge:
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]' if: github.actor == 'dependabot[bot]'
steps: steps:
- name: Create token
id: create_token
uses: tibdex/github-app-token@v2
with:
app_id: ${{ secrets.BIG_MERGER_APP_ID }}
private_key: ${{ secrets.BIG_MERGER_PRIVATE_KEY }}
- name: Dependabot metadata - name: Dependabot metadata
id: dependabot-metadata id: dependabot-metadata
uses: dependabot/fetch-metadata@v1 uses: dependabot/fetch-metadata@v1
with: with:
github-token: '${{ secrets.GITHUB_TOKEN }}' github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Authenticate cli
run: echo "${{ steps.create_token.outputs.token }}" | gh auth login --with-token
- name: Enable auto-merge for Dependabot PRs - name: Enable auto-merge for Dependabot PRs
if: contains(fromJSON('["version-update:semver-patch", "version-update:semver-minor"]'), steps.dependabot-metadata.outputs.update-type) if: contains(fromJSON('["version-update:semver-patch", "version-update:semver-minor"]'), steps.dependabot-metadata.outputs.update-type)
run: gh pr merge --auto --squash "$PR_URL" run: gh pr merge --auto --squash "$PR_URL"
env: env:
PR_URL: ${{github.event.pull_request.html_url}} PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}