Skip to content

Commit 7c91859

Browse files
Merge pull request #1010 from PowerGridModel/feature/ci-add-check-no-label
CI: add check no label
2 parents a6ef48a + 96958f5 commit 7c91859

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

.github/workflows/check-blocking-labels.yml renamed to .github/workflows/check-pr-labels.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# SPDX-License-Identifier: MPL-2.0
44

5-
name: Check Blocking Labels
5+
name: Check PR Labels
66

77
on:
88
# run pipeline on pull request
@@ -18,14 +18,22 @@ on:
1818
workflow_dispatch:
1919

2020
concurrency:
21-
group: ${{ github.workflow }}-${{ github.ref }}-blocking-labels
21+
group: ${{ github.workflow }}-${{ github.ref }}-pr-labels
2222
cancel-in-progress: true
2323

2424
jobs:
25-
check-blocking-labels:
25+
check-pr-labels:
2626
runs-on: ubuntu-latest
2727
steps:
28-
28+
29+
- name: fail-if-no-label
30+
if: github.event_name == 'pull_request'
31+
run: |
32+
if [ "$(jq '.pull_request.labels | length' "$GITHUB_EVENT_PATH")" -eq 0 ]; then
33+
echo "This pull request has no labels. Please add at least one label."
34+
exit 1
35+
fi
36+
2937
- name: do-not-merge
3038
if: contains(github.event.pull_request.labels.*.name, 'do-not-merge')
3139
run: |

0 commit comments

Comments
 (0)