Skip to content

Commit 6a8705e

Browse files
[release/v7.5]Add GitHub Actions workflow to verify PR labels (#25159)
Co-authored-by: Travis Plunk <travis.plunk@microsoft.com>
1 parent d9edb3d commit 6a8705e

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

.github/workflows/labels.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Copyright (c) Microsoft Corporation.
2+
# Licensed under the MIT License.
3+
4+
name: Verify PR Labels
5+
6+
on:
7+
pull_request:
8+
types: [opened, reopened, edited, labeled, unlabeled, synchronize]
9+
10+
permissions:
11+
contents: read
12+
pull-requests: read
13+
14+
jobs:
15+
verify-labels:
16+
if: github.repository_owner == 'PowerShell'
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: Check out the repository
21+
uses: actions/checkout@v2
22+
23+
- name: Verify PR has label starting with 'cl-'
24+
id: verify-labels
25+
uses: actions/github-script@v6
26+
with:
27+
script: |
28+
const labels = context.payload.pull_request.labels.map(label => label.name.toLowerCase());
29+
if (!labels.some(label => label.startsWith('cl-'))) {
30+
core.setFailed("Every PR must have at least one label starting with 'cl-'.");
31+
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy