-
Notifications
You must be signed in to change notification settings - Fork 682
66 lines (62 loc) · 2.36 KB
/
label_check.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
name: Release Note Label Check
# Trigger the workflow on pull requests only
on:
pull_request:
types: [opened, labeled, unlabeled, synchronize]
branches: [main]
permissions:
contents: read
env:
GOPROXY: https://proxy.golang.org/
jobs:
# Ensures correct release-note labels are set:
# - At least one label
# - At most one of the main category labels
# - A deprecation label alone or with something other than "none-required"
# Ensures you can have a change that is just a deprecation, or include a
# deprecation with another release note.
check-label:
name: Check release-note label set
runs-on: ubuntu-latest
steps:
- uses: mheap/github-action-required-labels@d25134c992b943fb6ad00c25ea00eb5988c0a9dd # v5.4.2
with:
mode: minimum
count: 1
labels: "release-note/major, release-note/minor, release-note/small, release-note/docs, release-note/infra, release-note/deprecation, release-note/none-required"
- uses: mheap/github-action-required-labels@d25134c992b943fb6ad00c25ea00eb5988c0a9dd # v5.4.2
with:
mode: maximum
count: 1
labels: "release-note/major, release-note/minor, release-note/small, release-note/docs, release-note/infra, release-note/none-required"
- uses: mheap/github-action-required-labels@d25134c992b943fb6ad00c25ea00eb5988c0a9dd # v5.4.2
with:
mode: maximum
count: 1
labels: "release-note/deprecation, release-note/none-required"
check-changelog:
name: Check for changelog file
needs: [check-label]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
# * Module download cache
# * Build cache (Linux)
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-${{ github.job }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-${{ github.job }}-go-
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
with:
go-version: 'stable'
cache: false
- run: go run ./hack/actions/check-changefile-exists.go
env:
PR_NUMBER: ${{ github.event.number }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}