Skip to content

Commit 7329bfd

Browse files
committed
Add auto-approve&merge workflow for dependabot
1 parent febd101 commit 7329bfd

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# https://docs.github.com/en/code-security/dependabot/working-with-dependabot/automating-dependabot-with-github-actions
2+
name: Dependabot auto-approve and merge
3+
on: pull_request
4+
5+
permissions:
6+
pull-requests: write
7+
8+
env:
9+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
10+
11+
jobs:
12+
dependabot:
13+
runs-on: ubuntu-latest
14+
if: github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == 'splunk/splunk-sdk-python'
15+
steps:
16+
- name: Dependabot metadata
17+
uses: dependabot/fetch-metadata@496eb7a6d053154f00e01044ab472077386f5a35
18+
with:
19+
github-token: "${{ secrets.GITHUB_TOKEN }}"
20+
- name: Approve and auto-merge
21+
run: |
22+
gh pr review --approve "${{ github.event.pull_request.html_url }}"
23+
gh pr merge --auto --merge "${{ github.event.pull_request.html_url }}"

0 commit comments

Comments
 (0)