forked from LandSandBoat/server
-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (31 loc) · 926 Bytes
/
pr_labels.yml
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
name: "pr_labels"
on:
pull_request_target:
types:
- opened
- labeled
- unlabeled
- synchronize
- reopened
jobs:
Check_Blocking_Labels:
runs-on: ubuntu-latest
permissions: write-all
steps:
- uses: actions/github-script@v6
with:
script: |
const response = await github.rest.issues.listLabelsOnIssue({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
});
for (const idx in response.data)
{
const entry = response.data[idx];
if (entry.name === "hold" || entry.name === "squash")
{
console.log("Found PR-blocking label: " + entry.name)
core.setFailed("Found PR-blocking label: " + entry.name)
}
}