Skip to content

Commit 3f11817

Browse files
committed
Add action that fails if a PR has no label attached
1 parent bd3914b commit 3f11817

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

.github/workflows/_label.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
on:
2+
workflow_call:
3+
inputs:
4+
pr_number:
5+
required: true
6+
type: number
7+
8+
jobs:
9+
label:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
issues: write
13+
pull-requests: write
14+
steps:
15+
- uses: mheap/github-action-required-labels@v5
16+
with:
17+
count: 1
18+
add_comment: true
19+
message: "Please attach a label to this PR. This helps with generating helpful release notes."

.github/workflows/ci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ jobs:
88
check:
99
uses: ./.github/workflows/_check.yml
1010

11+
require-label:
12+
if: github.event_name == 'pull_request'
13+
uses: ./.github/workflows/_label.yml
14+
with:
15+
pr_number: ${{ github.event.pull_request.number }}
16+
1117
lint:
1218
needs: check
1319
if: needs.check.outputs.branch-pr == ''

0 commit comments

Comments
 (0)