Move auto-merge to separate workflow
This commit is contained in:
parent
993dcdbc45
commit
d255667dfb
29
.github/workflows/auto-merge.yml
vendored
Normal file
29
.github/workflows/auto-merge.yml
vendored
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
name: Dependabot auto-merge
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
issues: write
|
||||||
|
pull-requests: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
auto-merge:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: github.actor == 'dependabot[bot]'
|
||||||
|
steps:
|
||||||
|
- name: Dependabot metadata
|
||||||
|
id: dependabot-metadata
|
||||||
|
uses: dependabot/fetch-metadata@v1
|
||||||
|
with:
|
||||||
|
github-token: '${{ secrets.GITHUB_TOKEN }}'
|
||||||
|
- 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 review --approve "$PR_URL"
|
||||||
|
gh pr merge --auto --squash "$PR_URL"
|
||||||
|
env:
|
||||||
|
PR_URL: ${{github.event.pull_request.html_url}}
|
||||||
|
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
23
.github/workflows/ci.yml
vendored
23
.github/workflows/ci.yml
vendored
@ -31,29 +31,6 @@ jobs:
|
|||||||
name: build
|
name: build
|
||||||
path: ./public
|
path: ./public
|
||||||
|
|
||||||
dependabot:
|
|
||||||
name: Dependabot Auto-Merge
|
|
||||||
needs: build
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
issues: write
|
|
||||||
pull-requests: write
|
|
||||||
if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}}
|
|
||||||
steps:
|
|
||||||
- name: Dependabot metadata
|
|
||||||
id: dependabot-metadata
|
|
||||||
uses: dependabot/fetch-metadata@v1
|
|
||||||
with:
|
|
||||||
github-token: '${{ secrets.GITHUB_TOKEN }}'
|
|
||||||
- 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 review --approve "$PR_URL"
|
|
||||||
gh pr merge --auto --squash "$PR_URL"
|
|
||||||
env:
|
|
||||||
PR_URL: ${{github.event.pull_request.html_url}}
|
|
||||||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
needs: build
|
needs: build
|
||||||
name: Deploy to GitHub Pages
|
name: Deploy to GitHub Pages
|
||||||
|
Loading…
Reference in New Issue
Block a user