Skip to content

chore(ci): add contribution labeler #4103

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

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions .github/opened-pr-contribution-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# https://github.com/actions/labeler

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

This file was deleted.

35 changes: 29 additions & 6 deletions .github/workflows/on_pull_request_open.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,39 @@ name: Opened Pull Request Labeler

on:
pull_request:
types: [opened]
types: [opened, synchronize]

jobs:
pr-triage:
pr-context-labeller:
Copy link
Collaborator

Choose a reason for hiding this comment

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

labeller vs labeler ? this is one of those words that I can never actually remember how to spell lol. I think it's labeler

runs-on: ubuntu-latest
steps:
- name: Auto labeller
- name: Assign Author
uses: technote-space/assign-author@v1

- 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 }}"
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: Check user for team affiliation
uses: tspascoal/get-user-teams-membership@v2
id: teamAffiliationList
with:
GITHUB_TOKEN: "${{ secrets.PAT_GH_READ_ORG }}"
username: "${{ github.actor }}"

- name: Debug groups
run: echo "${{ steps.teamAffiliationList.outputs.teams }}"

- name: Auto contribution labeller
if: ${{ steps.teamAffiliation.outputs.isTeamMember == 'false' }}
uses: actions/labeler@v4
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
configuration-path: .github/opened-pr-labeler.yml
- name: Assign Author
uses: technote-space/assign-author@v1
configuration-path: .github/opened-pr-contribution-labeler.yml
Loading