From e0ae9c02579acd393043c5fa6018b19741741491 Mon Sep 17 00:00:00 2001 From: Kristian Antrobus Date: Mon, 14 Oct 2024 11:58:53 -0500 Subject: [PATCH 1/9] chore(ci): add contribution labeler --- .github/opened-pr-contribution-labeler.yml | 5 +++++ .github/opened-pr-labeler.yml | 5 ----- .github/workflows/on_pull_request_open.yml | 18 ++++++++++++++---- 3 files changed, 19 insertions(+), 9 deletions(-) create mode 100644 .github/opened-pr-contribution-labeler.yml delete mode 100644 .github/opened-pr-labeler.yml diff --git a/.github/opened-pr-contribution-labeler.yml b/.github/opened-pr-contribution-labeler.yml new file mode 100644 index 0000000000..8d1b4b8ae4 --- /dev/null +++ b/.github/opened-pr-contribution-labeler.yml @@ -0,0 +1,5 @@ +# https://github.com/actions/labeler + +# Add 'Contribution' label to any opened PR when author external to team +"Contribution": + - "**/*" 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_open.yml b/.github/workflows/on_pull_request_open.yml index b76c95762e..13fe334a17 100644 --- a/.github/workflows/on_pull_request_open.yml +++ b/.github/workflows/on_pull_request_open.yml @@ -8,10 +8,20 @@ jobs: pr-triage: 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.TOKEN }} + username: ${{ inputs.USER_NAME }} + team: "twilio-labs/design-systems-eng,twilio-labs/design-systems-pd" + + - 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 From 801b1dd879f9c42aff13b6eaef56081fd3547d10 Mon Sep 17 00:00:00 2001 From: Kristian Antrobus Date: Mon, 14 Oct 2024 12:02:22 -0500 Subject: [PATCH 2/9] chore(ci): update env var --- .github/workflows/on_pull_request_open.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/on_pull_request_open.yml b/.github/workflows/on_pull_request_open.yml index 13fe334a17..f3c74e8003 100644 --- a/.github/workflows/on_pull_request_open.yml +++ b/.github/workflows/on_pull_request_open.yml @@ -15,7 +15,7 @@ jobs: uses: tspascoal/get-user-teams-membership@v2 id: teamAffiliation with: - GITHUB_TOKEN: ${{ secrets.TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} username: ${{ inputs.USER_NAME }} team: "twilio-labs/design-systems-eng,twilio-labs/design-systems-pd" From 21a87a4d8c73033c8eb1cf7c501b8223aee43c98 Mon Sep 17 00:00:00 2001 From: Kristian Antrobus Date: Mon, 14 Oct 2024 12:06:49 -0500 Subject: [PATCH 3/9] chore(ci): update triggers --- .github/workflows/on_pull_request_open.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/on_pull_request_open.yml b/.github/workflows/on_pull_request_open.yml index f3c74e8003..68e6d24d72 100644 --- a/.github/workflows/on_pull_request_open.yml +++ b/.github/workflows/on_pull_request_open.yml @@ -2,7 +2,7 @@ name: Opened Pull Request Labeler on: pull_request: - types: [opened] + types: [opened, reopened] jobs: pr-triage: From 5aae6cd5c84175b5e4ee5063810629b80222ed92 Mon Sep 17 00:00:00 2001 From: Kristian Antrobus Date: Mon, 14 Oct 2024 12:09:20 -0500 Subject: [PATCH 4/9] chore(ci): update username var --- .github/workflows/on_pull_request_open.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/on_pull_request_open.yml b/.github/workflows/on_pull_request_open.yml index 68e6d24d72..8f1ce3aad0 100644 --- a/.github/workflows/on_pull_request_open.yml +++ b/.github/workflows/on_pull_request_open.yml @@ -16,7 +16,7 @@ jobs: id: teamAffiliation with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - username: ${{ inputs.USER_NAME }} + username: ${{ github.actor }} team: "twilio-labs/design-systems-eng,twilio-labs/design-systems-pd" - name: Auto contribution labeller From a0f846e5f69892616c8fd6db6271b807a6738caf Mon Sep 17 00:00:00 2001 From: Kristian Antrobus Date: Mon, 14 Oct 2024 12:17:20 -0500 Subject: [PATCH 5/9] chore(ci): update env --- .github/workflows/on_pull_request_open.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/on_pull_request_open.yml b/.github/workflows/on_pull_request_open.yml index 8f1ce3aad0..7fc000adac 100644 --- a/.github/workflows/on_pull_request_open.yml +++ b/.github/workflows/on_pull_request_open.yml @@ -15,7 +15,7 @@ jobs: uses: tspascoal/get-user-teams-membership@v2 id: teamAffiliation with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.PAT_GH_READ_ORG }} username: ${{ github.actor }} team: "twilio-labs/design-systems-eng,twilio-labs/design-systems-pd" From 4bbe2dcb1b622af8dda5616ff48b7415e0269d14 Mon Sep 17 00:00:00 2001 From: Kristian Antrobus Date: Mon, 14 Oct 2024 12:23:26 -0500 Subject: [PATCH 6/9] chore(ci): debug step --- .github/workflows/on_pull_request_open.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/on_pull_request_open.yml b/.github/workflows/on_pull_request_open.yml index 7fc000adac..08b168c2bd 100644 --- a/.github/workflows/on_pull_request_open.yml +++ b/.github/workflows/on_pull_request_open.yml @@ -19,6 +19,9 @@ jobs: username: ${{ github.actor }} team: "twilio-labs/design-systems-eng,twilio-labs/design-systems-pd" + - name: Debug in group + run: echo "${{ github.actor }} is team member ${{ steps.teamAffiliation.outputs.isTeamMember }}" + - name: Auto contribution labeller if: ${{ steps.teamAffiliation.outputs.isTeamMember == 'false' }} uses: actions/labeler@v4 From 759d6a88eb8b45e0c7dc70fb493a486c0380c5fa Mon Sep 17 00:00:00 2001 From: Kristian Antrobus Date: Mon, 14 Oct 2024 12:26:03 -0500 Subject: [PATCH 7/9] chore(ci): update teams --- .github/workflows/on_pull_request_open.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/on_pull_request_open.yml b/.github/workflows/on_pull_request_open.yml index 08b168c2bd..72ddad3df5 100644 --- a/.github/workflows/on_pull_request_open.yml +++ b/.github/workflows/on_pull_request_open.yml @@ -2,7 +2,7 @@ name: Opened Pull Request Labeler on: pull_request: - types: [opened, reopened] + types: [opened, synchronize] jobs: pr-triage: @@ -17,7 +17,7 @@ jobs: with: GITHUB_TOKEN: ${{ secrets.PAT_GH_READ_ORG }} username: ${{ github.actor }} - team: "twilio-labs/design-systems-eng,twilio-labs/design-systems-pd" + team: "design-systems-eng,design-systems-pd" - name: Debug in group run: echo "${{ github.actor }} is team member ${{ steps.teamAffiliation.outputs.isTeamMember }}" From c146b337c31e2e0730880fc657343e59bbd41b13 Mon Sep 17 00:00:00 2001 From: Kristian Antrobus Date: Mon, 14 Oct 2024 12:30:05 -0500 Subject: [PATCH 8/9] chore(ci): debug --- .github/workflows/on_pull_request_open.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/on_pull_request_open.yml b/.github/workflows/on_pull_request_open.yml index 72ddad3df5..ff2bc58631 100644 --- a/.github/workflows/on_pull_request_open.yml +++ b/.github/workflows/on_pull_request_open.yml @@ -5,7 +5,7 @@ on: types: [opened, synchronize] jobs: - pr-triage: + pr-context-labeller: runs-on: ubuntu-latest steps: - name: Assign Author @@ -22,6 +22,16 @@ jobs: - 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 From e7028ff91a2344fe90e82d37b94109f81b2c818d Mon Sep 17 00:00:00 2001 From: Kristian Antrobus Date: Mon, 14 Oct 2024 12:35:50 -0500 Subject: [PATCH 9/9] chore(ci): wip --- .github/workflows/on_pull_request_open.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/on_pull_request_open.yml b/.github/workflows/on_pull_request_open.yml index ff2bc58631..02c2fe1ff6 100644 --- a/.github/workflows/on_pull_request_open.yml +++ b/.github/workflows/on_pull_request_open.yml @@ -15,9 +15,9 @@ jobs: uses: tspascoal/get-user-teams-membership@v2 id: teamAffiliation with: - GITHUB_TOKEN: ${{ secrets.PAT_GH_READ_ORG }} - username: ${{ github.actor }} - team: "design-systems-eng,design-systems-pd" + 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 }}" @@ -26,8 +26,8 @@ jobs: uses: tspascoal/get-user-teams-membership@v2 id: teamAffiliationList with: - GITHUB_TOKEN: ${{ secrets.PAT_GH_READ_ORG }} - username: ${{ github.actor }} + GITHUB_TOKEN: "${{ secrets.PAT_GH_READ_ORG }}" + username: "${{ github.actor }}" - name: Debug groups run: echo "${{ steps.teamAffiliationList.outputs.teams }}"