Skip to content

Commit 779cd45

Browse files
chore: Contribution labeller (#4104)
* chore(ci): add contribution labeler * chore(ci): update env var * chore(ci): update triggers * chore(ci): update username var * chore(ci): update env * chore(ci): debug step * chore(ci): update teams * chore(ci): debug * chore(ci): wip * chore(ci): wip * chore(ci): wip * chore(ci): wip * chore(ci): wip * chore(ci): update ver * chore(ci): wip * chore(ci): wip * chore(ci): wip * chore(ci): wip * chore(ci): wip * chore(ci): wip * chore(ci): wip * chore(ci): final imp * chore(ci): final test * chore(ci): final impl * chore(ci): change ton only fire on open * chore(ci): spelling update * chore(deps): update ubuntu version --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
1 parent afba2ae commit 779cd45

File tree

5 files changed

+54
-28
lines changed

5 files changed

+54
-28
lines changed

.github/labeler.yml

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,42 +2,49 @@
22

33
# Add 'repo' label to any root file changes
44
"Area: Repo":
5-
- "*"
5+
- changed-files:
6+
- any-glob-to-any-file: "*/**"
67

78
"Area: Primitives":
8-
- packages/paste-core/primitives/**/*
9+
- changed-files:
10+
- any-glob-to-any-file: packages/paste-core/primitives/**/*
911

1012
"Area: Layout":
11-
- packages/paste-core/layout/**/*
13+
- changed-files:
14+
- any-glob-to-any-file: packages/paste-core/layout/**/*
1215

1316
"Area: Components":
14-
- packages/paste-core/components/**/*
17+
- changed-files:
18+
- any-glob-to-any-file: packages/paste-core/components/**/*
1519

1620
"Area: Core bundle":
17-
- packages/paste-core/core-bundle/**/*
21+
- changed-files:
22+
- any-glob-to-any-file: packages/paste-core/core-bundle/**/*
1823

1924
"Area: Doc Site":
20-
- packages/paste-website/**/*
25+
- changed-files:
26+
- any-glob-to-any-file: packages/paste-website/**/*
2127

2228
"Area: Theme":
23-
- packages/paste-theme/**/*
29+
- changed-files:
30+
- any-glob-to-any-file: packages/paste-theme/**/*
2431

2532
"Area: Tokens":
26-
- packages/paste-design-tokens/**/*
33+
- changed-files:
34+
- any-glob-to-any-file: packages/paste-design-tokens/**/*
2735

2836
"Area: Storybook":
29-
- .storybook/**/*
37+
- changed-files:
38+
- any-glob-to-any-file: .storybook/**/*
3039

3140
"Area: Infrastructure":
32-
- .eslint/**/*
33-
- .github/**/*
34-
- .jest/**/*
35-
- .vscode/**/*
36-
- tools/**/*
41+
- changed-files:
42+
- any-glob-to-any-file: [".github/**/*", ".jest/**/*", ".storybook/**/*", ".vscode/**/*", "tools/**/*"]
3743

3844
"Type: Documentation":
39-
- packages/paste-website/src/pages/**/*
45+
- changed-files:
46+
- any-glob-to-any-file: packages/paste-website/src/pages/**/*
4047

4148
"Type: Tests":
42-
- "**/__tests__/**/*"
43-
- cypress/**/*
49+
- changed-files:
50+
- any-glob-to-any-file: ["**/__tests__/**/*", "cypress/**/*"]
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# https://github.com/actions/labeler
2+
3+
# Add 'Contribution' label to any opened PR when author external to team
4+
"Contribution":
5+
- changed-files:
6+
- any-glob-to-any-file: "*/**"

.github/opened-pr-labeler.yml

Lines changed: 0 additions & 5 deletions
This file was deleted.

.github/workflows/on_pull_request.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,8 @@ jobs:
382382

383383
storybook_tests:
384384
name: Storybook test runner
385-
runs-on: ubuntu-latest
385+
# Causes playwrite issues in latest versions. Upgrading deps causes violations in the storybook tests.
386+
runs-on: ubuntu-22.04
386387
timeout-minutes: 20
387388
needs: chromatic
388389
strategy:
@@ -450,7 +451,7 @@ jobs:
450451
- name: Checkout Repo
451452
uses: actions/checkout@v4
452453

453-
- uses: actions/labeler@v4
454+
- uses: actions/labeler@v5
454455
with:
455456
repo-token: "${{ secrets.GITHUB_TOKEN }}"
456457
sync-labels: true

.github/workflows/on_pull_request_open.yml

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,30 @@ on:
55
types: [opened]
66

77
jobs:
8-
pr-triage:
8+
pr-context-labeler:
99
runs-on: ubuntu-latest
1010
steps:
11-
- name: Auto labeller
12-
uses: actions/labeler@v4
11+
- name: Checkout Repo
12+
uses: actions/checkout@v4
13+
14+
- name: Check user for team affiliation
15+
uses: tspascoal/get-user-teams-membership@v2
16+
id: teamAffiliation
17+
with:
18+
GITHUB_TOKEN: "${{ secrets.PAT_GH_READ_ORG }}"
19+
username: "${{ github.actor }}"
20+
# List of all teams for dsys
21+
team: "[Design Systems PD,design-systems,Design Systems Eng,Design Systems Eng Leads]"
22+
23+
- name: Debug in group
24+
run: echo "${{ github.actor }} is team member ${{ steps.teamAffiliation.outputs.isTeamMember }}"
25+
26+
- name: Auto contribution labeler
27+
if: ${{ steps.teamAffiliation.outputs.isTeamMember == 'false' }}
28+
uses: actions/labeler@v5
1329
with:
1430
repo-token: "${{ secrets.GITHUB_TOKEN }}"
15-
configuration-path: .github/opened-pr-labeler.yml
31+
configuration-path: .github/opened-pr-contribution-labeler.yml
32+
1633
- name: Assign Author
1734
uses: technote-space/assign-author@v1

0 commit comments

Comments
 (0)