Skip to content

Commit 29571f6

Browse files
authored
chore: automate workspace labels for PRs (#2763)
* chore: automate workspace labels for PRs Signed-off-by: Patrick Knight <pknight@redhat.com> * chore: automate issues and harden the runs Signed-off-by: Patrick Knight <pknight@redhat.com> * chore: fix sonarqube complaints Signed-off-by: Patrick Knight <pknight@redhat.com> * chore: add labeler.yml for issue labels Signed-off-by: Patrick Knight <pknight@redhat.com> --------- Signed-off-by: Patrick Knight <pknight@redhat.com>
1 parent 2d0d82c commit 29571f6

File tree

3 files changed

+206
-0
lines changed

3 files changed

+206
-0
lines changed

.github/labeler.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
workspace/adoption-insights:
2+
- 'Workspace\\s*adoption-insights'
3+
4+
workspace/ai-integrations:
5+
- 'Workspace\\s*ai-integrations'
6+
7+
workspace/app-defaults:
8+
- 'Workspace\\s*app-defaults'
9+
10+
workspace/augment:
11+
- 'Workspace\\s*augment'
12+
13+
workspace/bulk-import:
14+
- 'Workspace\\s*bulk-import'
15+
16+
workspace/cost-management:
17+
- 'Workspace\\s*cost-management'
18+
19+
workspace/dcm:
20+
- 'Workspace\\s*dcm'
21+
22+
workspace/extensions:
23+
- 'Workspace\\s*extensions'
24+
25+
workspace/global-floating-action-button:
26+
- 'Workspace\\s*global-floating-action-button'
27+
28+
workspace/global-header:
29+
- 'Workspace\\s*global-header'
30+
31+
workspace/homepage:
32+
- 'Workspace\\s*homepage'
33+
34+
workspace/konflux:
35+
- 'Workspace\\s*konflux'
36+
37+
workspace/lightspeed:
38+
- 'Workspace\\s*lightspeed'
39+
40+
workspace/mcp-integrations:
41+
- 'Workspace\\s*mcp-integrations'
42+
43+
workspace/noop:
44+
- 'Workspace\\s*noop'
45+
46+
workspace/orchestrator:
47+
- 'Workspace\\s*orchestrator'
48+
49+
workspace/quickstart:
50+
- 'Workspace\\s*quickstart'
51+
52+
workspace/repo-tools:
53+
- 'Workspace\\s*repo-tools'
54+
55+
workspace/sandbox:
56+
- 'Workspace\\s*sandbox'
57+
58+
workspace/scorecard:
59+
- 'Workspace\\s*scorecard'
60+
61+
workspace/theme:
62+
- 'Workspace\\s*theme'
63+
64+
workspace/translations:
65+
- 'Workspace\\s*translations'
66+
67+
workspace/x2a:
68+
- 'Workspace\\s*x2a'

.github/pr-labeler.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
workspace/adoption-insights:
2+
- changed-files:
3+
- any-glob-to-any-file: ['workspaces/adoption-insights/**']
4+
5+
workspace/ai-integrations:
6+
- changed-files:
7+
- any-glob-to-any-file: ['workspaces/ai-integrations/**']
8+
9+
workspace/app-defaults:
10+
- changed-files:
11+
- any-glob-to-any-file: ['workspaces/app-defaults/**']
12+
13+
workspace/augment:
14+
- changed-files:
15+
- any-glob-to-any-file: ['workspaces/augment/**']
16+
17+
workspace/bulk-import:
18+
- changed-files:
19+
- any-glob-to-any-file: ['workspaces/bulk-import/**']
20+
21+
workspace/cost-management:
22+
- changed-files:
23+
- any-glob-to-any-file: ['workspaces/cost-management/**']
24+
25+
workspace/dcm:
26+
- changed-files:
27+
- any-glob-to-any-file: ['workspaces/dcm/**']
28+
29+
workspace/extensions:
30+
- changed-files:
31+
- any-glob-to-any-file: ['workspaces/extensions/**']
32+
33+
workspace/global-floating-action-button:
34+
- changed-files:
35+
- any-glob-to-any-file: ['workspaces/global-floating-action-button/**']
36+
37+
workspace/global-header:
38+
- changed-files:
39+
- any-glob-to-any-file: ['workspaces/global-header/**']
40+
41+
workspace/homepage:
42+
- changed-files:
43+
- any-glob-to-any-file: ['workspaces/homepage/**']
44+
45+
workspace/konflux:
46+
- changed-files:
47+
- any-glob-to-any-file: ['workspaces/konflux/**']
48+
49+
workspace/lightspeed:
50+
- changed-files:
51+
- any-glob-to-any-file: ['workspaces/lightspeed/**']
52+
53+
workspace/mcp-integrations:
54+
- changed-files:
55+
- any-glob-to-any-file: ['workspaces/mcp-integrations/**']
56+
57+
workspace/noop:
58+
- changed-files:
59+
- any-glob-to-any-file: ['workspaces/noop/**']
60+
61+
workspace/orchestrator:
62+
- changed-files:
63+
- any-glob-to-any-file: ['workspaces/orchestrator/**']
64+
65+
workspace/quickstart:
66+
- changed-files:
67+
- any-glob-to-any-file: ['workspaces/quickstart/**']
68+
69+
workspace/repo-tools:
70+
- changed-files:
71+
- any-glob-to-any-file: ['workspaces/repo-tools/**']
72+
73+
workspace/sandbox:
74+
- changed-files:
75+
- any-glob-to-any-file: ['workspaces/sandbox/**']
76+
77+
workspace/scorecard:
78+
- changed-files:
79+
- any-glob-to-any-file: ['workspaces/scorecard/**']
80+
81+
workspace/theme:
82+
- changed-files:
83+
- any-glob-to-any-file: ['workspaces/theme/**']
84+
85+
workspace/translations:
86+
- changed-files:
87+
- any-glob-to-any-file: ['workspaces/translations/**']
88+
89+
workspace/x2a:
90+
- changed-files:
91+
- any-glob-to-any-file: ['workspaces/x2a/**']
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# PR and issue workspace path labels (workspace/<dir>) for search and triage.
2+
# Based on: https://github.com/backstage/community-plugins/blob/main/.github/workflows/add-workspace-label.yml
3+
name: Add workspace labels to PRs
4+
5+
on:
6+
issues:
7+
types: [opened, edited]
8+
pull_request_target:
9+
types:
10+
- opened
11+
- synchronize
12+
- reopened
13+
14+
jobs:
15+
triage-issues:
16+
if: github.event_name == 'issues'
17+
runs-on: ubuntu-latest
18+
permissions:
19+
issues: write
20+
contents: read
21+
steps:
22+
- name: Harden Runner
23+
uses: step-security/harden-runner@58077d3c7e43986b6b15fba718e8ea69e387dfcc # v2.15.1
24+
with:
25+
egress-policy: audit
26+
27+
- uses: github/issue-labeler@c1b0f9f52a63158c4adc09425e858e87b32e9685 #v3.4
28+
with:
29+
configuration-path: .github/labeler.yml
30+
enable-versioned-regex: 0
31+
repo-token: ${{ secrets.GITHUB_TOKEN }}
32+
33+
label-prs:
34+
runs-on: ubuntu-latest
35+
permissions:
36+
pull-requests: write
37+
contents: read
38+
steps:
39+
- name: Harden Runner
40+
uses: step-security/harden-runner@58077d3c7e43986b6b15fba718e8ea69e387dfcc # v2.15.1
41+
with:
42+
egress-policy: audit
43+
44+
- uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9 # v5.0.0
45+
with:
46+
configuration-path: .github/pr-labeler.yml
47+
repo-token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)