Skip to content

Commit 5f59209

Browse files
authored
ci: Add auto-merge workflow for Dependabot dependency updates [TAROT-3531] (#61)
1 parent d603300 commit 5f59209

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Automatically merge (using squash) dependency update PRs, opened by Dependabot, under the following conditions:
2+
#
3+
# - PR was opened by dependabot[bot].
4+
# - Dependency update is a minor or patch update. This is determined based on Dependabot's metadata.
5+
# - Configured required checks pass.
6+
#
7+
# PRs are approved and merged by user codacybeta (https://github.com/orgs/codacy/people/codacybeta), using its
8+
# AUTO_MERGE_TOKEN.
9+
name: Auto-merge Dependabot dependency updates
10+
11+
on:
12+
pull_request:
13+
14+
jobs:
15+
auto-merge:
16+
name: Auto-merge Dependabot dependency updates
17+
runs-on: ubuntu-latest
18+
if: github.event.pull_request.user.login == 'dependabot[bot]'
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@v4
22+
- name: Get Dependabot metadata
23+
id: metadata
24+
uses: dependabot/fetch-metadata@v2
25+
with:
26+
github-token: ${{ secrets.AUTO_MERGE_TOKEN }}
27+
- name: Approve PR and set it to auto-merge
28+
if: steps.metadata.outputs.update-type == 'version-update:semver-patch' || steps.metadata.outputs.update-type == 'version-update:semver-minor'
29+
run: |
30+
gh pr review --approve ${{ github.event.pull_request.number }}
31+
gh pr merge --squash --auto ${{ github.event.pull_request.number }}
32+
env:
33+
GH_TOKEN: ${{ secrets.AUTO_MERGE_TOKEN }}

0 commit comments

Comments
 (0)