-
-
Notifications
You must be signed in to change notification settings - Fork 489
36 lines (33 loc) · 1015 Bytes
/
Copy pathpr-checks.yml
File metadata and controls
36 lines (33 loc) · 1015 Bytes
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
name: PR Checks
on:
pull_request:
types:
- opened
- synchronize
- reopened
- labeled
- unlabeled
- edited
permissions:
pull-requests: read
jobs:
quality-gates:
name: Quality Gates
runs-on: ubuntu-latest
steps:
- name: PR Quality Gates
uses: actions/github-script@v8
with:
script: |
const { data: pr } = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number
});
const labels = pr.labels.map(l => l.name);
if (labels.some(l => l.includes('DO NOT MERGE')))
core.setFailed('PR specifies label DO NOT MERGE');
if (labels.some(l => l.includes('Engineers at work')) || pr.title.includes('[WIP]'))
core.warning('PR is marked as Work in Progress');
if (pr.additions + pr.deletions > 5000)
core.warning('Big PR');