diff --git a/.github/labeler.yml b/.github/labeler.yml index 7cc6631b04..4b11970fbc 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -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/**/*"] diff --git a/.github/opened-pr-contribution-labeler.yml b/.github/opened-pr-contribution-labeler.yml new file mode 100644 index 0000000000..46b1e143d0 --- /dev/null +++ b/.github/opened-pr-contribution-labeler.yml @@ -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: "*/**" diff --git a/.github/opened-pr-labeler.yml b/.github/opened-pr-labeler.yml deleted file mode 100644 index 3b77ee3001..0000000000 --- a/.github/opened-pr-labeler.yml +++ /dev/null @@ -1,5 +0,0 @@ -# https://github.com/actions/labeler - -# Add 'Status: Do Not Merge' label to any newly opened PR -"Status: Do Not Merge": - - "**/*" diff --git a/.github/workflows/on_pull_request.yml b/.github/workflows/on_pull_request.yml index 457fc1fc34..7dc9548a95 100644 --- a/.github/workflows/on_pull_request.yml +++ b/.github/workflows/on_pull_request.yml @@ -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: @@ -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 diff --git a/.github/workflows/on_pull_request_open.yml b/.github/workflows/on_pull_request_open.yml index b76c95762e..6c7c415904 100644 --- a/.github/workflows/on_pull_request_open.yml +++ b/.github/workflows/on_pull_request_open.yml @@ -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