-
Notifications
You must be signed in to change notification settings - Fork 0
21 lines (19 loc) · 1.1 KB
/
one_release_label.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Check to make sure there is one, and only one, release tag applied
name: Check for release labels
on:
pull_request:
types: [opened, reopened, synchronize, labeled, unlabeled]
branches: main
jobs:
one_release_label:
runs-on: ubuntu-latest
steps:
- name: At least one release label applied
if: "!(contains(github.event.pull_request.labels.*.name, 'release-major') || contains(github.event.pull_request.labels.*.name, 'release-minor') || contains(github.event.pull_request.labels.*.name, 'release-patch'))"
run: exit 1
- name: If major label is applied, no other release labels exist
if: "contains(github.event.pull_request.labels.*.name, 'release-major') && (contains(github.event.pull_request.labels.*.name, 'release-minor') || contains(github.event.pull_request.labels.*.name, 'release-patch'))"
run: exit 1
- name: If minor label is applied, no other release labels exist
if: "contains(github.event.pull_request.labels.*.name, 'release-minor') && contains(github.event.pull_request.labels.*.name, 'release-patch')"
run: exit 1