Skip to content

Commit 992483c

Browse files
apop5makubacki
andauthored
Backport: use srvaroa/labeler@v1.12.0 instead of github/issue-labeler (#434)
Switch to using srvaroa/labeler instead of github/issue-labeler to allow more configuration options. Add backport labels for dependabot created PRs and for filesync operations as well. github/issue-labeler did not provide configuration to add labels based on PR author or PR branch target or PR branch name. Switching to allow automatically targeting FileSync operations and Dependabot Prs to be labeled backport. --------- Co-authored-by: Michael Kubacki <michael.kubacki@microsoft.com>
1 parent bedc328 commit 992483c

2 files changed

Lines changed: 41 additions & 18 deletions

File tree

.github/workflows/Labeler.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,12 @@ jobs:
4545
sync-labels: true
4646
if: github.event_name == 'pull_request' || github.event_name == 'pull_request_target'
4747

48-
- name: Apply Labels Based on PR Messages
49-
uses: github/issue-labeler@v3.1
48+
- name: Apply PR Labels Based on Policies
49+
uses: srvaroa/labeler@v1.12.0
5050
with:
51-
configuration-path: .github/workflows/label-issues/regex-pull-requests.yml
52-
enable-versioned-regex: 0
53-
repo-token: ${{ secrets.GITHUB_TOKEN }}
51+
config_path: .github/workflows/label-issues/regex-pull-requests.yml
52+
use_local_config: false
53+
fail_on_error: true
54+
env:
55+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5456
if: github.event_name == 'pull_request' || github.event_name == 'pull_request_target'

.sync/workflows/config/label-issues/regex-pull-requests.yml

Lines changed: 34 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,45 @@
1010
# SPDX-License-Identifier: BSD-2-Clause-Patent
1111
#
1212
# For more information, see:
13-
# https://github.com/github/issue-labeler
13+
# https://github.com/srvaroa/labeler
1414

1515
# Maintenance: Keep labels organized in ascending alphabetical order - easier to scan, identify duplicates, etc.
16+
version: 1
17+
issues: False
1618

17-
type:backport:
18-
- '\s*-\s*\[\s*[x|X]\s*\] Backport to release branch\?'
19+
labels:
20+
- label: type:backport
21+
type: "pull_request"
22+
body: '\s*\[\s*(x|X){1}\s*\]\s*Backport to release branch\?'
1923

20-
impact:breaking-change:
21-
- '\s*-\s*\[\s*[x|X]\s*\] Breaking change\?'
24+
- label: type:backport
25+
type: "pull_request"
26+
authors: ["mu-automation[bot]"]
27+
branch : "repo-sync/mu_devops/default"
28+
base-branch: "dev/20[0-9]{4}"
2229

23-
type:documentation:
24-
- '\s*-\s*\[\s*[x|X]\s*\] Includes documentation\?'
30+
- label: type:backport
31+
type: "pull_request"
32+
authors: ["dependabot[bot]"]
33+
branch : "dependabot/*"
34+
base-branch: "dev/20[0-9]{4}"
2535

26-
impact:non-functional:
27-
- '\s*-\s*\[\s*(?![x|X])\s*\] Impacts functionality\?'
36+
- label: impact:breaking-change
37+
type: "pull_request"
38+
body: '\s*\[\s*(x|X){1}\s*\]\s*Breaking\s*change\?'
2839

29-
impact:security:
30-
- '\s*-\s*\[\s*[x|X]\s*\] Impacts security\?'
40+
- label: type:documentation
41+
type: "pull_request"
42+
body: '\s*\[\s*(x|X){1}\s*\]\s*Includes\s*documentation\?'
3143

32-
impact:testing:
33-
- '\s*-\s*\[\s*[x|X]\s*\] Includes tests\?'
44+
- label: impact:non-functional
45+
type: "pull_request"
46+
body: '\s*\[\s*\]\s*Impacts\s*functionality\?'
47+
48+
- label: impact:security
49+
type: "pull_request"
50+
body: '\s*\[\s*(x|X){1}\s*\]\s*Impacts\s*security\?'
51+
52+
- label: impact:testing
53+
type: "pull_request"
54+
body: '\[\s*(x|X){1}\s*\]\s*Includes\s*tests\?'

0 commit comments

Comments
 (0)