-
Notifications
You must be signed in to change notification settings - Fork 17
31 lines (29 loc) · 1.17 KB
/
check_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
# File is copy-pasted and adapted from Integritee worker:
# https://github.com/integritee-network/worker/blob/1a58d6a625fa76935902f16c798efa453bcef9a4/.github/workflows/label-checker.yml
name: Check labels
on:
pull_request:
types: [opened, labeled, unlabeled, synchronize, ready_for_review]
jobs:
label-check:
runs-on: ubuntu-latest
if: github.base_ref == 'master' && github.event.pull_request.draft == false
strategy:
fail-fast: false
matrix:
include:
- test: A Label (change type)
enforced_labels: "A0-ux,A1-bugfix,A2-technical"
- test: B Label (urgency)
enforced_labels: "B0-low,B1-medium,B2-critical"
- test: C Label (breaking changes)
enforced_labels: "C0-breaksnothing,C1-breaksapi"
steps:
- name: Label check
run: |
MATCH=$(jq -cn '${{ toJSON(github.event.pull_request.labels.*.name) }} as $USER_LABELS |
${{ toJSON(matrix.enforced_labels) }} | split(",") as $LABELS |
$USER_LABELS - ($USER_LABELS - $LABELS)')
if [[ "$MATCH" == '[]' ]]; then
exit 1
fi