-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (41 loc) · 1.19 KB
/
label-pr.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
35
36
37
38
39
40
41
42
43
44
45
46
47
name: Set / Validate PR Labels
on:
pull_request_target:
branches:
- main
types:
- synchronize
- opened
- reopened
- labeled
- unlabeled
concurrency: pr_labels_${{ github.event.number }}
jobs:
autolabel:
name: Ensure Minimal Semver Labels
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Check Minimal Semver Labels
uses: mheap/github-action-required-labels@v3
with:
count: 1
labels: semver:major, semver:minor, semver:patch
mode: exactly
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Auto-label Semver
if: failure()
uses: initializ-buildpacks/github-config/actions/pull-request/auto-semver-label@main
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
- name: Verify Labels After Auto-label
if: always() # Ensure this runs even if the previous steps fail
uses: mheap/github-action-required-labels@v3
with:
count: 1
labels: semver:major, semver:minor, semver:patch
mode: exactly
env:
GITHUB_TOKEN: ${{ secrets.PAT }}