aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Raasch <425211+janraasch@users.noreply.github.com>2024-01-23 11:46:13 +0100
committerJan Raasch <425211+janraasch@users.noreply.github.com>2024-01-23 11:46:13 +0100
commitd255667dfb5ff4a7dedfe60f7e9222c9c6c72041 (patch)
tree8ca5c04e2dad52ad482f570815968f8205f3a677
parent993dcdbc45068da7d012dfd58b0f96ed3706b483 (diff)
downloadhugo-bearcub-d255667dfb5ff4a7dedfe60f7e9222c9c6c72041.tar.gz
hugo-bearcub-d255667dfb5ff4a7dedfe60f7e9222c9c6c72041.tar.bz2
Move auto-merge to separate workflow
-rw-r--r--.github/workflows/auto-merge.yml29
-rw-r--r--.github/workflows/ci.yml23
2 files changed, 29 insertions, 23 deletions
diff --git a/.github/workflows/auto-merge.yml b/.github/workflows/auto-merge.yml
new file mode 100644
index 0000000..3ea4f02
--- /dev/null
+++ b/.github/workflows/auto-merge.yml
@@ -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}}
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index c0820d8..581a78f 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -31,29 +31,6 @@ jobs:
name: build
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:
needs: build
name: Deploy to GitHub Pages