Skip to content

Commit 61b2952

Browse files
committed
Implement dependabot auto-merge workflows
1 parent d95334e commit 61b2952

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

.github/workflows/auto-approve.yml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Auto approve
2+
3+
on: pull_request_target
4+
5+
jobs:
6+
auto-approve:
7+
runs-on: ubuntu-latest
8+
permissions:
9+
pull-requests: write
10+
if: github.actor == 'dependabot[bot]'
11+
steps:
12+
- uses: hmarr/auto-approve-action@v3
13+
with:
14+
github-token: ${{ secrets.PAT_TOKEN }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Dependabot Auto-Merge
2+
on:
3+
pull_request_target:
4+
types:
5+
- opened
6+
workflow_run:
7+
workflows: ["Lint", "CodeQL"]
8+
branches: [dev]
9+
types:
10+
- completed
11+
12+
permissions:
13+
pull-requests: write
14+
contents: write
15+
16+
jobs:
17+
dependabot:
18+
runs-on: ubuntu-latest
19+
if: ${{ github.actor == 'dependabot[bot]'}}
20+
steps:
21+
- name: Dependabot metadata
22+
id: metadata
23+
uses: dependabot/fetch-metadata@v1
24+
with:
25+
github-token: "${{ secrets.GITHUB_TOKEN }}"
26+
- name: Enable auto-merge for Dependabot PRs
27+
if: ${{steps.metadata.outputs.update-type != 'version-update:semver-major'}}
28+
run: gh pr merge --auto --squash "$PR_URL"
29+
env:
30+
PR_URL: ${{github.event.pull_request.html_url}}
31+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

0 commit comments

Comments
 (0)