Skip to content

Commit e33de35

Browse files
Add Dependabot auto-approve and auto-merge workflow
Co-authored-by: BenjaminMichaelis <22186029+BenjaminMichaelis@users.noreply.github.com>
1 parent 206c9f3 commit e33de35

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
name: Dependabot auto-approve and auto-merge
6+
7+
on: pull_request
8+
9+
permissions:
10+
contents: write
11+
pull-requests: write
12+
13+
jobs:
14+
dependabot:
15+
runs-on: ubuntu-latest
16+
if: github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == 'IntelliTect/try'
17+
steps:
18+
- name: Dependabot metadata
19+
id: metadata
20+
uses: dependabot/fetch-metadata@v2
21+
with:
22+
github-token: "${{ secrets.GITHUB_TOKEN }}"
23+
24+
- name: Approve PR
25+
run: gh pr review --approve "$PR_URL"
26+
env:
27+
PR_URL: ${{ github.event.pull_request.html_url }}
28+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
30+
- name: Enable auto-merge for patch and minor updates
31+
if: |
32+
steps.metadata.outputs.update-type == 'version-update:semver-patch' ||
33+
steps.metadata.outputs.update-type == 'version-update:semver-minor'
34+
run: gh pr merge --auto --squash "$PR_URL"
35+
env:
36+
PR_URL: ${{ github.event.pull_request.html_url }}
37+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)