-
-
Notifications
You must be signed in to change notification settings - Fork 3
69 lines (64 loc) · 2.44 KB
/
pr.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: PR
on:
pull_request_target:
types:
- opened
- ready_for_review
- synchronize
jobs:
add-labels:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/labeler@v5.0.0
with:
repo-token: ${{ secrets.BOT_TOKEN }}
assign-author:
if: github.event.action == 'opened' && github.event.pull_request.user.login != 'dependabot[bot]'
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: technote-space/assign-author@v1.6.2
automerge-pr:
if: >
github.base_ref == 'main'
&& (
(github.event.action == 'opened' && !github.event.pull_request.draft)
|| github.event.action == 'ready_for_review')
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
# If we'd use `secrets.GITHUB_TOKEN`, our CI isn't triggered on the
# merge's push event.
# https://docs.github.com/en/actions/using-workflows/triggering-a-workflow#triggering-a-workflow-from-a-workflow
GITHUB_TOKEN: ${{ secrets.PR_AUTOMERGE_TOKEN }}
approve-dependabot-pr:
if: github.event.action == 'opened' && github.event.pull_request.user.login == 'dependabot[bot]'
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: dependabot/fetch-metadata@v1.6.0
id: dependabot-metadata
- name: Approve patch and minor updates
id: approve-patch-and-minor-updates
if: (steps.dependabot-metadata.outputs.update-type == 'version-update:semver-patch' || steps.dependabot-metadata.outputs.update-type == 'version-update:semver-minor') && steps.dependabot-metadata.outputs.dependency-names != '@types/vscode'
run: gh pr review "$PR_URL" --approve
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Request manual review for major updates
if: steps.approve-patch-and-minor-updates.outcome == 'skipped' && toJSON(github.event.pull_request.requested_reviewers) == '[]'
run: gh pr edit "$PR_URL" --add-reviewer JonasWanke
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}