Skip to content

Commit e13cf20

Browse files
committed
chore: automerge non-major dependabot PRs
1 parent c77d168 commit e13cf20

File tree

3 files changed

+33
-32
lines changed

3 files changed

+33
-32
lines changed

.github/dependabot.yml

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,10 @@
11
version: 2
22
updates:
3-
4-
# github actions
5-
63
- package-ecosystem: "github-actions"
74
directory: "/"
85
schedule:
9-
interval: "weekly"
10-
open-pull-requests-limit: 5
11-
labels: ["github-actions", "dependencies", "pr/automerge"]
12-
13-
# npm
14-
6+
interval: "daily"
157
- package-ecosystem: "npm"
168
directory: "/"
179
schedule:
18-
interval: "weekly"
19-
open-pull-requests-limit: 15
20-
labels: ["npm", "dependencies", "pr/automerge"]
10+
interval: "daily"

.github/workflows/automerge.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Dependabot auto-merge
2+
on: pull_request
3+
4+
permissions:
5+
contents: write
6+
pull-requests: write
7+
8+
jobs:
9+
dependabot:
10+
runs-on: ubuntu-latest
11+
if: ${{ github.actor == 'dependabot[bot]' }}
12+
steps:
13+
- name: Dependabot metadata
14+
id: metadata
15+
uses: dependabot/fetch-metadata@v1
16+
with:
17+
github-token: "${{ secrets.GITHUB_TOKEN }}"
18+
19+
- name: Approve a PR
20+
if: ${{ steps.dependabot-metadata.outputs.update-type != 'version-update:semver-major' }}
21+
run: gh pr review --approve "$PR_URL"
22+
env:
23+
PR_URL: ${{ github.event.pull_request.html_url }}
24+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25+
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 }}

.kodiak.toml

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)