From 939ef3bab9d1f94b1546894d1f62f393ef34e19c Mon Sep 17 00:00:00 2001 From: Mustafa-Zarkash Date: Fri, 30 Jun 2023 19:41:39 +0300 Subject: [PATCH 01/12] add auto labeler action --- .github/workflows/auto_community_labeler.yml | 31 ++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/auto_community_labeler.yml diff --git a/.github/workflows/auto_community_labeler.yml b/.github/workflows/auto_community_labeler.yml new file mode 100644 index 00000000000..491081367ba --- /dev/null +++ b/.github/workflows/auto_community_labeler.yml @@ -0,0 +1,31 @@ + +name: Auto Community Labeler + +on: + pull_request: + issues: + +jobs: + auto_community_labeler: + name: Auto PR Community Labeler + runs-on: ubuntu-latest + if: github.event.pull_request.author_association != 'OWNER' && github.event.pull_request.author_association != 'MEMBER' + + steps: + - name: Add Contributer Label + uses: actions-ecosystem/action-add-labels@v1 + if: github.event.pull_request.author_association == 'COLLABORATOR' || github.event.pull_request.author_association == 'CONTRIBUTOR' + with: + labels: community contribution_ + + author-issue-labeler: + name: Auto Issue Community Labeler + runs-on: ubuntu-latest + if: github.event.issue.author_association != 'OWNER' && github.event.issue.author_association != 'MEMBER' + + steps: + - name: Add Contributer Label + uses: actions-ecosystem/action-add-labels@v1 + if: github.event.issue.author_association == 'COLLABORATOR' || github.event.issue.author_association == 'CONTRIBUTOR' + with: + labels: community contribution From f70e08a8e69dbd4531d3b8ddc5d578d46e4bb9c6 Mon Sep 17 00:00:00 2001 From: Mustafa-Zarkash Date: Fri, 30 Jun 2023 20:27:40 +0300 Subject: [PATCH 02/12] avoid unnecessary runs --- .github/workflows/auto_community_labeler.yml | 22 +++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/.github/workflows/auto_community_labeler.yml b/.github/workflows/auto_community_labeler.yml index 491081367ba..946965a650a 100644 --- a/.github/workflows/auto_community_labeler.yml +++ b/.github/workflows/auto_community_labeler.yml @@ -9,23 +9,35 @@ jobs: auto_community_labeler: name: Auto PR Community Labeler runs-on: ubuntu-latest - if: github.event.pull_request.author_association != 'OWNER' && github.event.pull_request.author_association != 'MEMBER' + if: > + github.event_name == 'pull_request' && + github.event.pull_request.author_association != 'OWNER' && + github.event.pull_request.author_association != 'MEMBER' steps: - name: Add Contributer Label uses: actions-ecosystem/action-add-labels@v1 - if: github.event.pull_request.author_association == 'COLLABORATOR' || github.event.pull_request.author_association == 'CONTRIBUTOR' + if: > + github.event.pull_request.author_association == 'COLLABORATOR' || + github.event.pull_request.author_association == 'CONTRIBUTOR' + with: - labels: community contribution_ + labels: community contribution author-issue-labeler: name: Auto Issue Community Labeler runs-on: ubuntu-latest - if: github.event.issue.author_association != 'OWNER' && github.event.issue.author_association != 'MEMBER' + if: > + github.event_name == 'issue' && + github.event.issue.author_association != 'OWNER' && + github.event.issue.author_association != 'MEMBER' steps: - name: Add Contributer Label uses: actions-ecosystem/action-add-labels@v1 - if: github.event.issue.author_association == 'COLLABORATOR' || github.event.issue.author_association == 'CONTRIBUTOR' + if: > + github.event.issue.author_association == 'COLLABORATOR' || + github.event.issue.author_association == 'CONTRIBUTOR' + with: labels: community contribution From 7e6e8ab0030389ad4e840558735f8900312140c2 Mon Sep 17 00:00:00 2001 From: Mustafa-Zarkash Date: Fri, 30 Jun 2023 20:31:25 +0300 Subject: [PATCH 03/12] modify jobs name --- .github/workflows/auto_community_labeler.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/auto_community_labeler.yml b/.github/workflows/auto_community_labeler.yml index 946965a650a..2fa5254ea1b 100644 --- a/.github/workflows/auto_community_labeler.yml +++ b/.github/workflows/auto_community_labeler.yml @@ -6,7 +6,7 @@ on: issues: jobs: - auto_community_labeler: + auto_PR_labeler: name: Auto PR Community Labeler runs-on: ubuntu-latest if: > @@ -24,7 +24,7 @@ jobs: with: labels: community contribution - author-issue-labeler: + auto_Issue_labeler: name: Auto Issue Community Labeler runs-on: ubuntu-latest if: > From 7334aea27fe33b73230a6257dee9daba0c49b45a Mon Sep 17 00:00:00 2001 From: Mustafa-Zarkash Date: Fri, 30 Jun 2023 20:51:00 +0300 Subject: [PATCH 04/12] modify rules --- .github/workflows/auto_community_labeler.yml | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/.github/workflows/auto_community_labeler.yml b/.github/workflows/auto_community_labeler.yml index 2fa5254ea1b..87d712d72c4 100644 --- a/.github/workflows/auto_community_labeler.yml +++ b/.github/workflows/auto_community_labeler.yml @@ -9,17 +9,12 @@ jobs: auto_PR_labeler: name: Auto PR Community Labeler runs-on: ubuntu-latest - if: > - github.event_name == 'pull_request' && - github.event.pull_request.author_association != 'OWNER' && - github.event.pull_request.author_association != 'MEMBER' + if: github.event_name == 'pull_request' steps: - name: Add Contributer Label uses: actions-ecosystem/action-add-labels@v1 - if: > - github.event.pull_request.author_association == 'COLLABORATOR' || - github.event.pull_request.author_association == 'CONTRIBUTOR' + if: github.event.pull_request.author_association == 'COLLABORATOR' || github.event.pull_request.author_association == 'CONTRIBUTOR' with: labels: community contribution @@ -27,17 +22,12 @@ jobs: auto_Issue_labeler: name: Auto Issue Community Labeler runs-on: ubuntu-latest - if: > - github.event_name == 'issue' && - github.event.issue.author_association != 'OWNER' && - github.event.issue.author_association != 'MEMBER' + if: github.event_name == 'issue' steps: - name: Add Contributer Label uses: actions-ecosystem/action-add-labels@v1 - if: > - github.event.issue.author_association == 'COLLABORATOR' || - github.event.issue.author_association == 'CONTRIBUTOR' + if: github.event.issue.author_association == 'COLLABORATOR' || github.event.issue.author_association == 'CONTRIBUTOR' with: labels: community contribution From 8a019a5b048006a3d1fab6f931f1d957dbdb2c3c Mon Sep 17 00:00:00 2001 From: Mustafa-Zarkash Date: Fri, 30 Jun 2023 20:58:15 +0300 Subject: [PATCH 05/12] move conditions to job instead of steps --- .github/workflows/auto_community_labeler.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/auto_community_labeler.yml b/.github/workflows/auto_community_labeler.yml index 87d712d72c4..f4596f6f1d9 100644 --- a/.github/workflows/auto_community_labeler.yml +++ b/.github/workflows/auto_community_labeler.yml @@ -9,25 +9,20 @@ jobs: auto_PR_labeler: name: Auto PR Community Labeler runs-on: ubuntu-latest - if: github.event_name == 'pull_request' + if: github.event_name == 'pull_request' && github.event.pull_request.author_association == 'COLLABORATOR' || github.event.pull_request.author_association == 'CONTRIBUTOR' steps: - name: Add Contributer Label uses: actions-ecosystem/action-add-labels@v1 - if: github.event.pull_request.author_association == 'COLLABORATOR' || github.event.pull_request.author_association == 'CONTRIBUTOR' - with: labels: community contribution auto_Issue_labeler: name: Auto Issue Community Labeler runs-on: ubuntu-latest - if: github.event_name == 'issue' - + if: github.event_name == 'issue' && github.event.issue.author_association == 'COLLABORATOR' || github.event.issue.author_association == 'CONTRIBUTOR' steps: - name: Add Contributer Label uses: actions-ecosystem/action-add-labels@v1 - if: github.event.issue.author_association == 'COLLABORATOR' || github.event.issue.author_association == 'CONTRIBUTOR' - with: labels: community contribution From 13b794f3e1bf71e539fe0952a65f6b2251ae2992 Mon Sep 17 00:00:00 2001 From: Mustafa-Zarkash Date: Fri, 30 Jun 2023 23:30:32 +0300 Subject: [PATCH 06/12] fix conditional --- .github/workflows/auto_community_labeler.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/auto_community_labeler.yml b/.github/workflows/auto_community_labeler.yml index f4596f6f1d9..05db13092da 100644 --- a/.github/workflows/auto_community_labeler.yml +++ b/.github/workflows/auto_community_labeler.yml @@ -9,7 +9,7 @@ jobs: auto_PR_labeler: name: Auto PR Community Labeler runs-on: ubuntu-latest - if: github.event_name == 'pull_request' && github.event.pull_request.author_association == 'COLLABORATOR' || github.event.pull_request.author_association == 'CONTRIBUTOR' + if: github.event_name == 'pull_request' && github.event.pull_request.author_association != 'MEMBER' && github.event.pull_request.author_association != 'OWNER' steps: - name: Add Contributer Label @@ -20,7 +20,7 @@ jobs: auto_Issue_labeler: name: Auto Issue Community Labeler runs-on: ubuntu-latest - if: github.event_name == 'issue' && github.event.issue.author_association == 'COLLABORATOR' || github.event.issue.author_association == 'CONTRIBUTOR' + if: github.event_name == 'issues' && github.event.issue.author_association != 'MEMBER' && github.event.issue.author_association != 'OWNER' steps: - name: Add Contributer Label uses: actions-ecosystem/action-add-labels@v1 From 71cd3846a6a952384560979e8a1fb31503c59aec Mon Sep 17 00:00:00 2001 From: Mustafa-Zarkash Date: Sat, 1 Jul 2023 00:40:33 +0300 Subject: [PATCH 07/12] fix conditional and typo --- .github/workflows/auto_community_labeler.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/auto_community_labeler.yml b/.github/workflows/auto_community_labeler.yml index 05db13092da..dedef1c3031 100644 --- a/.github/workflows/auto_community_labeler.yml +++ b/.github/workflows/auto_community_labeler.yml @@ -9,10 +9,9 @@ jobs: auto_PR_labeler: name: Auto PR Community Labeler runs-on: ubuntu-latest - if: github.event_name == 'pull_request' && github.event.pull_request.author_association != 'MEMBER' && github.event.pull_request.author_association != 'OWNER' - + if: ${{ github.event_name == 'pull_request' && github.event.pull_request.author_association != 'MEMBER' && github.event.pull_request.author_association != 'OWNER' }} steps: - - name: Add Contributer Label + - name: Add Contributor Label uses: actions-ecosystem/action-add-labels@v1 with: labels: community contribution @@ -20,9 +19,9 @@ jobs: auto_Issue_labeler: name: Auto Issue Community Labeler runs-on: ubuntu-latest - if: github.event_name == 'issues' && github.event.issue.author_association != 'MEMBER' && github.event.issue.author_association != 'OWNER' + if: ${{ github.event_name == 'issues' && github.event.issue.author_association != 'MEMBER' && github.event.issue.author_association != 'OWNER' }} steps: - - name: Add Contributer Label + - name: Add Contributor Label uses: actions-ecosystem/action-add-labels@v1 with: labels: community contribution From e8fade2f3563335eddfdb2768f0ca9be9c41f2e8 Mon Sep 17 00:00:00 2001 From: Mustafa-Zarkash Date: Sat, 1 Jul 2023 01:01:47 +0300 Subject: [PATCH 08/12] test labeler --- .github/workflows/auto_community_labeler.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/auto_community_labeler.yml b/.github/workflows/auto_community_labeler.yml index dedef1c3031..99d4133fffc 100644 --- a/.github/workflows/auto_community_labeler.yml +++ b/.github/workflows/auto_community_labeler.yml @@ -16,6 +16,16 @@ jobs: with: labels: community contribution + debug_PR_labeler: + name: Debug PR Community Labeler + runs-on: ubuntu-latest + if: ${{ github.event_name == 'pull_request' && github.event.pull_request.author_association != 'MEMBER' && github.event.pull_request.author_association != 'OWNER' }} + steps: + - name: Add Contributor Label + run: | + author_type = $((github.event.pull_request.author_association)) + echo "::debug::$author_type" + auto_Issue_labeler: name: Auto Issue Community Labeler runs-on: ubuntu-latest From cf42f3963d8bf867c82fc94101de9152d2a2d23f Mon Sep 17 00:00:00 2001 From: Mustafa-Zarkash Date: Sat, 1 Jul 2023 01:08:09 +0300 Subject: [PATCH 09/12] test labeler --- .github/workflows/auto_community_labeler.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto_community_labeler.yml b/.github/workflows/auto_community_labeler.yml index 99d4133fffc..7297499a97a 100644 --- a/.github/workflows/auto_community_labeler.yml +++ b/.github/workflows/auto_community_labeler.yml @@ -23,7 +23,7 @@ jobs: steps: - name: Add Contributor Label run: | - author_type = $((github.event.pull_request.author_association)) + author_type = ${{ github.event.pull_request.author_association }} echo "::debug::$author_type" auto_Issue_labeler: From 1b0b4f14f70d31528e721ecdc33209a569a091c5 Mon Sep 17 00:00:00 2001 From: Mustafa-Zarkash Date: Sat, 1 Jul 2023 01:11:38 +0300 Subject: [PATCH 10/12] remove test labeler --- .github/workflows/auto_community_labeler.yml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/.github/workflows/auto_community_labeler.yml b/.github/workflows/auto_community_labeler.yml index 7297499a97a..dedef1c3031 100644 --- a/.github/workflows/auto_community_labeler.yml +++ b/.github/workflows/auto_community_labeler.yml @@ -16,16 +16,6 @@ jobs: with: labels: community contribution - debug_PR_labeler: - name: Debug PR Community Labeler - runs-on: ubuntu-latest - if: ${{ github.event_name == 'pull_request' && github.event.pull_request.author_association != 'MEMBER' && github.event.pull_request.author_association != 'OWNER' }} - steps: - - name: Add Contributor Label - run: | - author_type = ${{ github.event.pull_request.author_association }} - echo "::debug::$author_type" - auto_Issue_labeler: name: Auto Issue Community Labeler runs-on: ubuntu-latest From 476a7c7dc7007173d9b25f83e98c6e5a4edb6b5b Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Fri, 24 Nov 2023 15:24:47 +0200 Subject: [PATCH 11/12] add debugging code --- .github/workflows/auto_community_labeler.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/auto_community_labeler.yml b/.github/workflows/auto_community_labeler.yml index dedef1c3031..cf555d89ed7 100644 --- a/.github/workflows/auto_community_labeler.yml +++ b/.github/workflows/auto_community_labeler.yml @@ -25,3 +25,15 @@ jobs: uses: actions-ecosystem/action-add-labels@v1 with: labels: community contribution + + debug_labeler: + runs-on: ubuntu-latest + steps: + - name: get_author_association + env: + AUTHOR_ASSOCIATION: ${{ github.event.issue.author_association }} + run: echo "$AUTHOR_ASSOCIATION" + - name: check_condition + env: + CONDITION: ${{ github.event.issue.author_association != 'MEMBER' && github.event.issue.author_association != 'OWNER' }} + run: echo "$CONDITION" From 6218f090695cfa562bf6ed42541f3e144dd87784 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Fri, 24 Nov 2023 15:29:15 +0200 Subject: [PATCH 12/12] update debugging code --- .github/workflows/auto_community_labeler.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/auto_community_labeler.yml b/.github/workflows/auto_community_labeler.yml index cf555d89ed7..45a9cf48a83 100644 --- a/.github/workflows/auto_community_labeler.yml +++ b/.github/workflows/auto_community_labeler.yml @@ -31,9 +31,9 @@ jobs: steps: - name: get_author_association env: - AUTHOR_ASSOCIATION: ${{ github.event.issue.author_association }} + AUTHOR_ASSOCIATION: ${{ github.event.pull_request.author_association }} run: echo "$AUTHOR_ASSOCIATION" - name: check_condition env: - CONDITION: ${{ github.event.issue.author_association != 'MEMBER' && github.event.issue.author_association != 'OWNER' }} + CONDITION: ${{ github.event.pull_request.author_association != 'MEMBER' && github.event.pull_request.author_association != 'OWNER' }} run: echo "$CONDITION"