-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (49 loc) · 1.78 KB
/
Copy pathreview.yml
File metadata and controls
54 lines (49 loc) · 1.78 KB
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
name: Required Reviews
on:
pull_request_review:
pull_request:
types: [opened, reopened, synchronize]
jobs:
check:
name: Checking required reviews
runs-on: ubuntu-latest
permissions: {}
if: github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name
steps:
- name: Generate a token
id: generate-token
uses: actions/create-github-app-token@v2
with:
app-id: ${{ secrets.REQUIRED_REVIEWS_APP_ID }}
private-key: ${{ secrets.REQUIRED_REVIEWS_APP_KEY }}
- name: Auto-approve Dependabot PRs
if: github.event.pull_request.user.login == 'dependabot[bot]' && github.actor == 'dependabot[bot]'
env:
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
run: |
gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
/repos/${{ github.repository }}/statuses/${{ github.event.pull_request.head.sha }} \
-f state='success' \
-f context='Required Reviews' \
-f description='Dependabot PR auto-approved'
- uses: Automattic/action-required-review@v5.0.0
if: github.event.pull_request.user.login != 'dependabot[bot]' || github.actor != 'dependabot[bot]'
with:
token: ${{ steps.generate-token.outputs.token }}
status: Required Reviews
requirements: |
- name: Cloud provider files
paths:
- '.github/'
- 'terraform/'
teams:
- "officers"
- "infra-chairs"
- name: Base Requirement
paths: unmatched
teams:
- "officers"
- "infra-chairs"
- "infra-leads"