From 52669b1b6a746de0d8c1101af33510817a0e8d19 Mon Sep 17 00:00:00 2001 From: sy-b <94835959+sy-b@users.noreply.github.com> Date: Sun, 3 Jul 2022 00:28:11 +0530 Subject: commentCommands - add request-issue-improvement Signed-off-by: sy-b <94835959+sy-b@users.noreply.github.com> --- .github/workflows/assignme.yml | 20 ------------------ .github/workflows/commentCommands.yml | 40 +++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 20 deletions(-) delete mode 100644 .github/workflows/assignme.yml create mode 100644 .github/workflows/commentCommands.yml diff --git a/.github/workflows/assignme.yml b/.github/workflows/assignme.yml deleted file mode 100644 index 586033d..0000000 --- a/.github/workflows/assignme.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Assign issue/pull to the commenter - -on: - issue_comment: - types: created - -jobs: - assign: - runs-on: ubuntu-latest - if: | - github.event.comment.body == '/assignme' - steps: - - name: Assigning to commentor - run: | - curl \ - -X POST \ - -H "Accept: application/vnd.github+json" \ - -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ - https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/assignees \ - -d '{"assignees":["${{ github.event.comment.user.login }}"]}' diff --git a/.github/workflows/commentCommands.yml b/.github/workflows/commentCommands.yml new file mode 100644 index 0000000..5eeff3d --- /dev/null +++ b/.github/workflows/commentCommands.yml @@ -0,0 +1,40 @@ +name: Assign issue/pull to the commenter + +on: + issue_comment: + types: created + +jobs: + + assign-commentor: + runs-on: ubuntu-latest + if: | + github.event.comment.body == '/assignme' + steps: + - name: Assigning to commentor + run: | + curl \ + -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ + https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/assignees \ + -d '{"assignees":["${{ github.event.comment.user.login }}"]}' + + request-issue-framing-improvement: + runs-on: ubuntu-latest + if: | + github.event.comment.body == '/improve' && ( + github.event.comment.author_association == 'OWNER' || + github.event.comment.author_association == 'COLLABORATOR' || + github.event.comment.author_association == 'CONTRIBUTOR' ) + steps: + - name: request-issue-framing-improvement + run: | + curl \ + -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ + https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/comments \ + -d '{"body":"This issue is put on hold due to low quality. No reviews or fixes will be performed at this time. Eventually, it will be closed. While we appreciate your effort writing, we are not able to further investigate it. Please improve it by writing a better title or providing more details, and you may re-open it."}' + + -- cgit v1.2.3 From 029ca28e514d1021cf771175b37bde855abfdfd5 Mon Sep 17 00:00:00 2001 From: sy-b <94835959+sy-b@users.noreply.github.com> Date: Sun, 3 Jul 2022 00:53:56 +0530 Subject: add job -> add-label-duplicate GitHub-Bot adds "duplicate" label when owners, collaborators or contributors comment - /duplicate Signed-off-by: sy-b <94835959+sy-b@users.noreply.github.com> --- .github/workflows/commentCommands.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/commentCommands.yml b/.github/workflows/commentCommands.yml index 5eeff3d..393ee22 100644 --- a/.github/workflows/commentCommands.yml +++ b/.github/workflows/commentCommands.yml @@ -37,4 +37,21 @@ jobs: https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/comments \ -d '{"body":"This issue is put on hold due to low quality. No reviews or fixes will be performed at this time. Eventually, it will be closed. While we appreciate your effort writing, we are not able to further investigate it. Please improve it by writing a better title or providing more details, and you may re-open it."}' + add-label-duplicate: + runs-on: ubuntu-latest + if: | + startsWith(github.event.comment.body, "/duplicate") == '/add' && ( + github.event.comment.author_association == 'OWNER' || + github.event.comment.author_association == 'COLLABORATOR' || + github.event.comment.author_association == 'CONTRIBUTOR' ) + steps: + - name: add-label-duplicate + run: | + curl \ + -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ + https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/label \ + -d '{"labels":["duplicate"]}' + -- cgit v1.2.3 From b6538c3b256507b14c1062e97448d98a7402f7ba Mon Sep 17 00:00:00 2001 From: sy-b <94835959+sy-b@users.noreply.github.com> Date: Sat, 2 Jul 2022 19:42:45 +0000 Subject: revert & fix typo --- .github/workflows/commentCommands.yml | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/.github/workflows/commentCommands.yml b/.github/workflows/commentCommands.yml index 393ee22..07fe2b5 100644 --- a/.github/workflows/commentCommands.yml +++ b/.github/workflows/commentCommands.yml @@ -11,7 +11,7 @@ jobs: if: | github.event.comment.body == '/assignme' steps: - - name: Assigning to commentor + - name: Assigning to commenter run: | curl \ -X POST \ @@ -35,23 +35,4 @@ jobs: -H "Accept: application/vnd.github+json" \ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/comments \ - -d '{"body":"This issue is put on hold due to low quality. No reviews or fixes will be performed at this time. Eventually, it will be closed. While we appreciate your effort writing, we are not able to further investigate it. Please improve it by writing a better title or providing more details, and you may re-open it."}' - - add-label-duplicate: - runs-on: ubuntu-latest - if: | - startsWith(github.event.comment.body, "/duplicate") == '/add' && ( - github.event.comment.author_association == 'OWNER' || - github.event.comment.author_association == 'COLLABORATOR' || - github.event.comment.author_association == 'CONTRIBUTOR' ) - steps: - - name: add-label-duplicate - run: | - curl \ - -X POST \ - -H "Accept: application/vnd.github+json" \ - -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ - https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/label \ - -d '{"labels":["duplicate"]}' - - + -d '{"body":"This issue is put on hold due to low quality. No reviews or fixes will be performed at this time. Eventually, it will be closed. While we appreciate your effort writing, we are not able to further investigate it. Please improve it by writing a better title or providing more details, and you may re-open it."}' -- cgit v1.2.3 From 5c1500da44930dccc45c84c38745c15408682bb4 Mon Sep 17 00:00:00 2001 From: sy-b <94835959+sy-b@users.noreply.github.com> Date: Sun, 3 Jul 2022 01:20:58 +0530 Subject: fix name Signed-off-by: sy-b <94835959+sy-b@users.noreply.github.com> --- .github/workflows/commentCommands.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/commentCommands.yml b/.github/workflows/commentCommands.yml index 07fe2b5..b11a3c6 100644 --- a/.github/workflows/commentCommands.yml +++ b/.github/workflows/commentCommands.yml @@ -1,4 +1,4 @@ -name: Assign issue/pull to the commenter +name: commentCommands on: issue_comment: -- cgit v1.2.3 From 7a9d4b6e82a06fbabc49258c715f75830e310cc9 Mon Sep 17 00:00:00 2001 From: sy-b <94835959+sy-b@users.noreply.github.com> Date: Tue, 12 Jul 2022 18:02:19 +0530 Subject: Trigger if mentioned anywhere in the sentence Signed-off-by: sy-b <94835959+sy-b@users.noreply.github.com> --- .github/workflows/commentCommands.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/commentCommands.yml b/.github/workflows/commentCommands.yml index b11a3c6..e5ed4d9 100644 --- a/.github/workflows/commentCommands.yml +++ b/.github/workflows/commentCommands.yml @@ -23,10 +23,10 @@ jobs: request-issue-framing-improvement: runs-on: ubuntu-latest if: | - github.event.comment.body == '/improve' && ( + contains(github.event.comment.body,'/improve') && ( github.event.comment.author_association == 'OWNER' || github.event.comment.author_association == 'COLLABORATOR' || - github.event.comment.author_association == 'CONTRIBUTOR' ) + github.event.comment.author_association != 'CONTRIBUTOR' ) steps: - name: request-issue-framing-improvement run: | -- cgit v1.2.3 From 815b7372b6683f4670e0e91aa05b02049ee0090d Mon Sep 17 00:00:00 2001 From: sy-b <94835959+sy-b@users.noreply.github.com> Date: Tue, 12 Jul 2022 18:02:59 +0530 Subject: small fix Signed-off-by: sy-b <94835959+sy-b@users.noreply.github.com> --- .github/workflows/commentCommands.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/commentCommands.yml b/.github/workflows/commentCommands.yml index e5ed4d9..8bcb282 100644 --- a/.github/workflows/commentCommands.yml +++ b/.github/workflows/commentCommands.yml @@ -26,7 +26,7 @@ jobs: contains(github.event.comment.body,'/improve') && ( github.event.comment.author_association == 'OWNER' || github.event.comment.author_association == 'COLLABORATOR' || - github.event.comment.author_association != 'CONTRIBUTOR' ) + github.event.comment.author_association == 'CONTRIBUTOR' ) steps: - name: request-issue-framing-improvement run: | -- cgit v1.2.3 From 5b61c1679e9bc0cfbf9b8364d44d278a4c9c17ef Mon Sep 17 00:00:00 2001 From: sy-b <94835959+sy-b@users.noreply.github.com> Date: Tue, 12 Jul 2022 18:06:10 +0530 Subject: Improve - assign-commenter Signed-off-by: sy-b <94835959+sy-b@users.noreply.github.com> --- .github/workflows/commentCommands.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/commentCommands.yml b/.github/workflows/commentCommands.yml index 8bcb282..d94b732 100644 --- a/.github/workflows/commentCommands.yml +++ b/.github/workflows/commentCommands.yml @@ -6,10 +6,11 @@ on: jobs: - assign-commentor: + assign-commenter: runs-on: ubuntu-latest if: | - github.event.comment.body == '/assignme' + contains(github.event.comment.body, '/assignme') || + contains(github.event.comment.body, '/assign me') steps: - name: Assigning to commenter run: | -- cgit v1.2.3