Skip to content

chore: Contribution labeller #4104

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 28 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
e0ae9c0
chore(ci): add contribution labeler
krisantrobus Oct 14, 2024
801b1dd
chore(ci): update env var
krisantrobus Oct 14, 2024
21a87a4
chore(ci): update triggers
krisantrobus Oct 14, 2024
5aae6cd
chore(ci): update username var
krisantrobus Oct 14, 2024
a0f846e
chore(ci): update env
krisantrobus Oct 14, 2024
4bbe2dc
chore(ci): debug step
krisantrobus Oct 14, 2024
759d6a8
chore(ci): update teams
krisantrobus Oct 14, 2024
c146b33
chore(ci): debug
krisantrobus Oct 14, 2024
e7028ff
chore(ci): wip
krisantrobus Oct 14, 2024
4acef7d
chore(ci): wip
krisantrobus Oct 14, 2024
d84104d
chore(ci): wip
krisantrobus Oct 14, 2024
8c9e35b
chore(ci): wip
krisantrobus Oct 14, 2024
cd6c4cf
chore(ci): wip
krisantrobus Oct 14, 2024
795d062
chore(ci): update ver
krisantrobus Oct 14, 2024
3373b79
chore(ci): wip
krisantrobus Oct 14, 2024
f0f161f
chore(ci): wip
krisantrobus Oct 14, 2024
3bbf17b
chore(ci): wip
krisantrobus Oct 14, 2024
365b0c5
chore(ci): wip
krisantrobus Oct 14, 2024
b35a890
chore(ci): wip
krisantrobus Oct 14, 2024
2948c44
chore(ci): wip
krisantrobus Oct 14, 2024
a95b220
chore(ci): wip
krisantrobus Oct 14, 2024
78a01ee
chore(ci): final imp
krisantrobus Oct 14, 2024
2e4f446
chore(ci): final test
krisantrobus Oct 14, 2024
a857058
chore(ci): final impl
krisantrobus Oct 14, 2024
f9d8608
chore(ci): change ton only fire on open
krisantrobus Oct 14, 2024
8979108
chore(ci): spelling update
krisantrobus Oct 14, 2024
321b087
chore(deps): update ubuntu version
krisantrobus Oct 15, 2024
7c1d3ec
Merge branch 'main' into contribution-labeler
kodiakhq[bot] Oct 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 24 additions & 17 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,49 @@

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated file as part of major update of labeler action from 4 > 5

# Add 'repo' label to any root file changes
"Area: Repo":
- "*"
- changed-files:
- any-glob-to-any-file: "*/**"

"Area: Primitives":
- packages/paste-core/primitives/**/*
- changed-files:
- any-glob-to-any-file: packages/paste-core/primitives/**/*

"Area: Layout":
- packages/paste-core/layout/**/*
- changed-files:
- any-glob-to-any-file: packages/paste-core/layout/**/*

"Area: Components":
- packages/paste-core/components/**/*
- changed-files:
- any-glob-to-any-file: packages/paste-core/components/**/*

"Area: Core bundle":
- packages/paste-core/core-bundle/**/*
- changed-files:
- any-glob-to-any-file: packages/paste-core/core-bundle/**/*

"Area: Doc Site":
- packages/paste-website/**/*
- changed-files:
- any-glob-to-any-file: packages/paste-website/**/*

"Area: Theme":
- packages/paste-theme/**/*
- changed-files:
- any-glob-to-any-file: packages/paste-theme/**/*

"Area: Tokens":
- packages/paste-design-tokens/**/*
- changed-files:
- any-glob-to-any-file: packages/paste-design-tokens/**/*

"Area: Storybook":
- .storybook/**/*
- changed-files:
- any-glob-to-any-file: .storybook/**/*

"Area: Infrastructure":
- .eslint/**/*
- .github/**/*
- .jest/**/*
- .vscode/**/*
- tools/**/*
- changed-files:
- any-glob-to-any-file: [".github/**/*", ".jest/**/*", ".storybook/**/*", ".vscode/**/*", "tools/**/*"]

"Type: Documentation":
- packages/paste-website/src/pages/**/*
- changed-files:
- any-glob-to-any-file: packages/paste-website/src/pages/**/*

"Type: Tests":
- "**/__tests__/**/*"
- cypress/**/*
- changed-files:
- any-glob-to-any-file: ["**/__tests__/**/*", "cypress/**/*"]
6 changes: 6 additions & 0 deletions .github/opened-pr-contribution-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# https://github.com/actions/labeler

# Add 'Contribution' label to any opened PR when author external to team
"Contribution":
- changed-files:
- any-glob-to-any-file: "*/**"
5 changes: 0 additions & 5 deletions .github/opened-pr-labeler.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/on_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ jobs:
- name: Checkout Repo
uses: actions/checkout@v4

- uses: actions/labeler@v4
- uses: actions/labeler@v5
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
sync-labels: true
Expand Down
25 changes: 21 additions & 4 deletions .github/workflows/on_pull_request_open.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,30 @@ on:
types: [opened]

jobs:
pr-triage:
pr-context-labeler:
runs-on: ubuntu-latest
steps:
- name: Auto labeller
uses: actions/labeler@v4
- name: Checkout Repo
uses: actions/checkout@v4

- name: Check user for team affiliation
uses: tspascoal/get-user-teams-membership@v2
id: teamAffiliation
with:
GITHUB_TOKEN: "${{ secrets.PAT_GH_READ_ORG }}"
username: "${{ github.actor }}"
# List of all teams for dsys
team: "[Design Systems PD,design-systems,Design Systems Eng,Design Systems Eng Leads]"

- name: Debug in group
run: echo "${{ github.actor }} is team member ${{ steps.teamAffiliation.outputs.isTeamMember }}"

- name: Auto contribution labeler
if: ${{ steps.teamAffiliation.outputs.isTeamMember == 'false' }}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only run if not part of the team

uses: actions/labeler@v5
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
configuration-path: .github/opened-pr-labeler.yml
configuration-path: .github/opened-pr-contribution-labeler.yml

- name: Assign Author
uses: technote-space/assign-author@v1
Loading