Skip to content

Commit 7c9f6f6

Browse files
committed
Adding Dependabot-approver
1 parent ee82352 commit 7c9f6f6

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# https://docs.github.com/en/code-security/dependabot/working-with-dependabot/automating-dependabot-with-github-actions
2+
name: Approve and enable auto-merge for dependabot
3+
on: pull_request
4+
5+
permissions:
6+
contents: read
7+
8+
jobs:
9+
review:
10+
if: ${{ github.actor == 'dependabot[bot]' && github.repository == 'jetstack/version-checker' }}
11+
permissions:
12+
pull-requests: write # for approving a PR
13+
contents: write # for enabling auto-merge on a PR
14+
runs-on: ubuntu-24.04
15+
steps:
16+
- name: Dependabot metadata
17+
id: metadata
18+
uses: dependabot/fetch-metadata@c9c4182bf1b97f5224aee3906fd373f6b61b4526 # v1.6.0
19+
with:
20+
github-token: "${{ secrets.GITHUB_TOKEN }}"
21+
- name: Approve PR
22+
run: gh pr review --approve "$PR_URL"
23+
env:
24+
PR_URL: ${{github.event.pull_request.html_url}}
25+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
26+
- name: Enable auto-merge for Dependabot PRs
27+
run: gh pr merge --auto --squash "$PR_URL"
28+
env:
29+
PR_URL: ${{github.event.pull_request.html_url}}
30+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

0 commit comments

Comments
 (0)