Skip to content

Commit 484c02e

Browse files
committed
Add PR workflow
1 parent ae3d0b2 commit 484c02e

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

.github/workflows/pr.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: PR
2+
3+
on: pull_request_target
4+
5+
jobs:
6+
assign-author:
7+
if: github.event.action == 'opened'
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: samspills/[email protected]
11+
with:
12+
repo-token: ${{ secrets.BOT_TOKEN }}
13+
14+
approve-dependabot-pr:
15+
if: github.event.action == 'opened' && github.event.pull_request.user.login == 'dependabot[bot]'
16+
runs-on: ubuntu-latest
17+
permissions:
18+
pull-requests: read
19+
steps:
20+
- uses: dependabot/[email protected]
21+
id: dependabot-metadata
22+
- name: Merge patch and minor updates
23+
if: steps.dependabot-metadata.outputs.update-type == 'version-update:semver-patch' || steps.dependabot-metadata.outputs.update-type == 'version-update:semver-minor'
24+
run: gh pr merge --auto --merge "$PR_URL"
25+
env:
26+
PR_URL: ${{ github.event.pull_request.html_url }}
27+
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
28+
- name: Request manual review for major updates
29+
if: steps.dependabot-metadata.outputs.update-type == 'version-update:semver-major' && toJSON(github.event.pull_request.requested_reviewers) == '[]'
30+
run: gh pr edit "$PR_URL" --add-reviewer JonasWanke
31+
env:
32+
PR_URL: ${{ github.event.pull_request.html_url }}
33+
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}

0 commit comments

Comments
 (0)