ci(auto-merge): add auto-merge
Add auto-merge
This commit is contained in:
parent
d56111af78
commit
7d9cc50597
1 changed files with 33 additions and 0 deletions
33
.github/workflows/auto-merge.yml
vendored
Normal file
33
.github/workflows/auto-merge.yml
vendored
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
name: auto-merge
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request_target:
|
||||||
|
types:
|
||||||
|
- opened
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
pull-requests: write
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
auto-merge:
|
||||||
|
if: ${{ github.actor == 'dependabot[bot]' }}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Dependabot metadata
|
||||||
|
id: dependabot-metadata
|
||||||
|
uses: dependabot/fetch-metadata@v1.6.0
|
||||||
|
with:
|
||||||
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Approve Pull Request
|
||||||
|
if: ${{ steps.dependabot-metadata.outputs.update-type != 'version-update:semver-major' }}
|
||||||
|
run: gh pr review -R "${{ github.repository }}" --approve "${{ github.event.pull_request.number }}"
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Enable auto-merge for Dependabot PRs
|
||||||
|
if: ${{ steps.dependabot-metadata.outputs.update-type != 'version-update:semver-major' }}
|
||||||
|
run: gh pr merge -R "${{ github.repository }}" --merge --auto "${{ github.event.pull_request.number }}"
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
Loading…
Reference in a new issue