hugo-bearblog/.github/workflows/auto-merge.yml

42 lines
1.1 KiB
YAML
Raw Normal View History

2024-02-20 10:07:38 -05:00
# see https://gist.github.com/xt0rted/46475099dc0a70ba63e16e3177407872
2024-01-23 05:46:13 -05:00
name: Dependabot auto-merge
on:
pull_request:
branches:
2024-02-20 10:07:38 -05:00
- master
2024-01-23 05:46:13 -05:00
permissions:
2024-02-20 10:07:38 -05:00
contents: read
pull-requests: read
2024-01-23 05:46:13 -05:00
jobs:
auto-merge:
runs-on: ubuntu-latest
2024-02-20 10:07:38 -05:00
2024-01-23 05:46:13 -05:00
if: github.actor == 'dependabot[bot]'
2024-02-20 10:07:38 -05:00
2024-01-23 05:46:13 -05:00
steps:
2024-02-20 10:07:38 -05:00
- 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 }}
2024-01-23 05:46:13 -05:00
- name: Dependabot metadata
id: dependabot-metadata
uses: dependabot/fetch-metadata@v1
with:
2024-02-20 10:07:38 -05:00
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Authenticate cli
run: echo "${{ steps.create_token.outputs.token }}" | gh auth login --with-token
2024-01-23 05:46:13 -05:00
- name: Enable auto-merge for Dependabot PRs
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"
2024-01-23 05:46:13 -05:00
env:
PR_URL: ${{github.event.pull_request.html_url}}