-
Notifications
You must be signed in to change notification settings - Fork 182
66 lines (61 loc) · 2.38 KB
/
release-notes-labels.yaml
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
55
56
57
58
59
60
61
62
63
64
65
66
# Prepare and validate a PR for auto-generated release notes:
# - if the title starts with `feat` or `fix` adds the label (`feat`, `fix`) used
# by the release notes to include the PR in the appropriate section.
# - each PR that is a `feat` or `fix` must also include either a
# `feature flagged`, `no release notes` or `release notes` label, PRs that have
# the `feature flagged` or `no release notes` label will not be included in
# the release notes.
#
name: Release Notes - Labels
on:
pull_request:
types: [opened, edited, labeled, unlabeled, synchronize]
jobs:
label:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: remove label not matching title - fix
if: |
startsWith(github.event.pull_request.title, 'fix:') ||
startsWith(github.event.pull_request.title, 'fix(')
uses: actions-ecosystem/action-remove-labels@v1
with:
labels: feat
- name: remove label not matching title - feat
if: |
startsWith(github.event.pull_request.title, 'feat:') ||
startsWith(github.event.pull_request.title, 'feat(')
uses: actions-ecosystem/action-remove-labels@v1
with:
labels: fix
- name: add label based on title - fix
if: |
startsWith(github.event.pull_request.title, 'fix:') ||
startsWith(github.event.pull_request.title, 'fix(')
uses: actions-ecosystem/action-add-labels@v1
with:
labels: fix
- name: add label based on title - feat
if: |
startsWith(github.event.pull_request.title, 'feat:') ||
startsWith(github.event.pull_request.title, 'feat(')
uses: actions-ecosystem/action-add-labels@v1
with:
labels: feat
- uses: mheap/github-action-required-labels@v1
with:
mode: maximum
count: 0
labels: "wip, work in progress, work-in-progress"
- uses: mheap/github-action-required-labels@v1
if: |
startsWith(github.event.pull_request.title, 'fix:') ||
startsWith(github.event.pull_request.title, 'fix(') ||
startsWith(github.event.pull_request.title, 'feat:') ||
startsWith(github.event.pull_request.title, 'feat(')
with:
mode: minimum
count: 1
labels: "feature flagged, no release notes, release notes"