Skip to content

Commit

Permalink
chore: Contribution labeller (#4104)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
krisantrobus and kodiakhq[bot] authored Oct 16, 2024
1 parent afba2ae commit 779cd45
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 28 deletions.
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 @@

# 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.

5 changes: 3 additions & 2 deletions .github/workflows/on_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,8 @@ jobs:

storybook_tests:
name: Storybook test runner
runs-on: ubuntu-latest
# Causes playwrite issues in latest versions. Upgrading deps causes violations in the storybook tests.
runs-on: ubuntu-22.04
timeout-minutes: 20
needs: chromatic
strategy:
Expand Down Expand Up @@ -450,7 +451,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' }}
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

0 comments on commit 779cd45

Please sign in to comment.