From 8617b4b97d1e5cfa33da7fcf4b2641ce489b92a7 Mon Sep 17 00:00:00 2001 From: Priyansh Mehta <96513964+Priyansh61@users.noreply.github.com> Date: Thu, 18 May 2023 20:59:38 +0530 Subject: [PATCH 1/7] New workflow ping-for-attention.yml created --- .github/workflows/ping-for-attention.yml | 53 ++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/ping-for-attention.yml diff --git a/.github/workflows/ping-for-attention.yml b/.github/workflows/ping-for-attention.yml new file mode 100644 index 00000000..fb532e46 --- /dev/null +++ b/.github/workflows/ping-for-attention.yml @@ -0,0 +1,53 @@ +# This action is centrally managed in https://github.com/asyncapi/.github/ +# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo + +# It uses Github actions to listen for comments on issues and pull requests and +# if the comment contains /ping-for-attention or /pfa it will add a comment pinging +# the code-owners who have not yet reviewed the pull request + +name: ping-for-attention + +on: + issue_comment: + types: [created] + +jobs: + ping-for-attention: + if: > + github.event.issue.pull_request && + github.event.issue.state != 'closed' && + github.actor != 'asyncapi-bot' && + ( + contains(github.event.comment.body, '/ping-for-attention') || + contains(github.event.comment.body, '/pfa') + ) + runs-on: ubuntu-latest + steps: + - name: Check for Ping for Attention Command + uses: actions/github-script@v6 + with: + github-token: ${{ secrets.GH_TOKEN }} + script: | + const prDetailsUrl = context.payload.issue.pull_request.url; + const { data: pull } = await github.request(prDetailsUrl); + const reviewers = pull.requested_reviewers.map(reviewer => reviewer.login); + + const { data: reviews } = await github.rest.pulls.listReviews({ + owner: context.repo.owner, + repo: context.repo.repo, + pull_number: context.issue.number + }); + + const reviewersWhoHaveReviewed = reviews.map(review => review.user.login); + + const reviewersWhoHaveNotReviewed = reviewers.filter(reviewer => !reviewersWhoHaveReviewed.includes(reviewer)); + + if (reviewersWhoHaveNotReviewed.length > 0) { + const comment = reviewersWhoHaveNotReviewed.map(reviewer => `@${reviewer}`).join(' '); + await github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: `${comment} Please take a look at this PR. Thanks! :wave:` + }); + } From 48cd26fa7387c2a5799b19764e6e578742166005 Mon Sep 17 00:00:00 2001 From: Priyansh Mehta <96513964+Priyansh61@users.noreply.github.com> Date: Sat, 27 May 2023 16:00:44 +0530 Subject: [PATCH 2/7] Update help-command.yml --- .github/workflows/help-command.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/help-command.yml b/.github/workflows/help-command.yml index f4955c22..007a35a7 100644 --- a/.github/workflows/help-command.yml +++ b/.github/workflows/help-command.yml @@ -33,7 +33,11 @@ jobs: - `/ready-to-merge` or `/rtm` - This comment will trigger automerge of PR in case all required checks are green, approvals in place and do-not-merge label is not added - `/do-not-merge` or `/dnm` - This comment will block automerging even if all conditions are met and ready-to-merge label is added - - `/autoupdate` or `/au` - This comment will add `autoupdate` label to the PR and keeps your PR up-to-date to the target branch's future changes. Unless there is a merge conflict or it is a draft PR.` + - `/autoupdate` or `/au` - This comment will add `autoupdate` label to the PR and keeps your PR up-to-date to the target branch's future changes. Unless there is a merge conflict or it is a draft PR. + - `/ping-for-attention` or `/pfa` or `/ptal` - This comment will add a comment to the PR asking for attention from the reviewrs who have not reviewed the PR yet. + - `/review` or `/rerequest` - This comment will add the given reviewers to the PR and request them to review the PR. It can be used in two ways. + - `/review @reviewer1 @reviewer2` - This will add the given reviewers to the PR and request them to review the PR. + - `/review` - This will add the default reviewers to the PR and request them to re-review the PR. The default reviewers are the ones who have reviewed the PR before.` }) create_help_comment_issue: From c04c57f49dcf52ae07060511542e33beee6165f2 Mon Sep 17 00:00:00 2001 From: Priyansh Mehta <96513964+Priyansh61@users.noreply.github.com> Date: Sat, 27 May 2023 16:02:08 +0530 Subject: [PATCH 3/7] Update ping-for-attention.yml --- .github/workflows/ping-for-attention.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ping-for-attention.yml b/.github/workflows/ping-for-attention.yml index fb532e46..486fe19c 100644 --- a/.github/workflows/ping-for-attention.yml +++ b/.github/workflows/ping-for-attention.yml @@ -19,7 +19,9 @@ jobs: github.actor != 'asyncapi-bot' && ( contains(github.event.comment.body, '/ping-for-attention') || - contains(github.event.comment.body, '/pfa') + contains(github.event.comment.body, '/pfa') || + contains(github.event.comment.body, '/ptal') || + contains(github.event.comment.body, '/PTAL') ) runs-on: ubuntu-latest steps: From be70e5fdea038fcf550b5fa1bc8432cf528ed43f Mon Sep 17 00:00:00 2001 From: Priyansh Mehta <96513964+Priyansh61@users.noreply.github.com> Date: Tue, 30 May 2023 14:09:48 +0530 Subject: [PATCH 4/7] Update help-command.yml --- .github/workflows/help-command.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/help-command.yml b/.github/workflows/help-command.yml index 007a35a7..2599161e 100644 --- a/.github/workflows/help-command.yml +++ b/.github/workflows/help-command.yml @@ -34,7 +34,7 @@ jobs: - `/ready-to-merge` or `/rtm` - This comment will trigger automerge of PR in case all required checks are green, approvals in place and do-not-merge label is not added - `/do-not-merge` or `/dnm` - This comment will block automerging even if all conditions are met and ready-to-merge label is added - `/autoupdate` or `/au` - This comment will add `autoupdate` label to the PR and keeps your PR up-to-date to the target branch's future changes. Unless there is a merge conflict or it is a draft PR. - - `/ping-for-attention` or `/pfa` or `/ptal` - This comment will add a comment to the PR asking for attention from the reviewrs who have not reviewed the PR yet. + - `/please-take-a-look` or `/ptal` - This comment will add a comment to the PR asking for attention from the reviewrs who have not reviewed the PR yet. - `/review` or `/rerequest` - This comment will add the given reviewers to the PR and request them to review the PR. It can be used in two ways. - `/review @reviewer1 @reviewer2` - This will add the given reviewers to the PR and request them to review the PR. - `/review` - This will add the default reviewers to the PR and request them to re-review the PR. The default reviewers are the ones who have reviewed the PR before.` From ff0e5943d64f268ff799f570a0e233faeee5103e Mon Sep 17 00:00:00 2001 From: Priyansh Mehta <96513964+Priyansh61@users.noreply.github.com> Date: Tue, 30 May 2023 14:12:06 +0530 Subject: [PATCH 5/7] Update and rename ping-for-attention.yml to please-take-a-look-command.yml --- ...ng-for-attention.yml => please-take-a-look-command.yml} | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) rename .github/workflows/{ping-for-attention.yml => please-take-a-look-command.yml} (91%) diff --git a/.github/workflows/ping-for-attention.yml b/.github/workflows/please-take-a-look-command.yml similarity index 91% rename from .github/workflows/ping-for-attention.yml rename to .github/workflows/please-take-a-look-command.yml index 486fe19c..216055ca 100644 --- a/.github/workflows/ping-for-attention.yml +++ b/.github/workflows/please-take-a-look-command.yml @@ -5,7 +5,7 @@ # if the comment contains /ping-for-attention or /pfa it will add a comment pinging # the code-owners who have not yet reviewed the pull request -name: ping-for-attention +name: Please take a Look on: issue_comment: @@ -18,14 +18,13 @@ jobs: github.event.issue.state != 'closed' && github.actor != 'asyncapi-bot' && ( - contains(github.event.comment.body, '/ping-for-attention') || - contains(github.event.comment.body, '/pfa') || + contains(github.event.comment.body, '/please-take-a-look') || contains(github.event.comment.body, '/ptal') || contains(github.event.comment.body, '/PTAL') ) runs-on: ubuntu-latest steps: - - name: Check for Ping for Attention Command + - name: Check for Please Take a Look Command uses: actions/github-script@v6 with: github-token: ${{ secrets.GH_TOKEN }} From ec48edc08232bd8b2d612ef155a6547dc14b9660 Mon Sep 17 00:00:00 2001 From: Khuda Dad Nomani <32505158+KhudaDad414@users.noreply.github.com> Date: Tue, 12 Mar 2024 14:05:53 +0000 Subject: [PATCH 6/7] Update help-command.yml --- .github/workflows/help-command.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/help-command.yml b/.github/workflows/help-command.yml index 2599161e..bdacd25b 100644 --- a/.github/workflows/help-command.yml +++ b/.github/workflows/help-command.yml @@ -35,9 +35,6 @@ jobs: - `/do-not-merge` or `/dnm` - This comment will block automerging even if all conditions are met and ready-to-merge label is added - `/autoupdate` or `/au` - This comment will add `autoupdate` label to the PR and keeps your PR up-to-date to the target branch's future changes. Unless there is a merge conflict or it is a draft PR. - `/please-take-a-look` or `/ptal` - This comment will add a comment to the PR asking for attention from the reviewrs who have not reviewed the PR yet. - - `/review` or `/rerequest` - This comment will add the given reviewers to the PR and request them to review the PR. It can be used in two ways. - - `/review @reviewer1 @reviewer2` - This will add the given reviewers to the PR and request them to review the PR. - - `/review` - This will add the default reviewers to the PR and request them to re-review the PR. The default reviewers are the ones who have reviewed the PR before.` }) create_help_comment_issue: From 6acfd13b103e355d41bf743a40584c2e475fbd0d Mon Sep 17 00:00:00 2001 From: Khuda Dad Nomani <32505158+KhudaDad414@users.noreply.github.com> Date: Tue, 12 Mar 2024 14:10:56 +0000 Subject: [PATCH 7/7] add to global replicator --- .github/workflows/global-replicator.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/global-replicator.yml b/.github/workflows/global-replicator.yml index df0b23f3..2cd366c2 100644 --- a/.github/workflows/global-replicator.yml +++ b/.github/workflows/global-replicator.yml @@ -138,7 +138,7 @@ jobs: uses: derberg/manage-files-in-multiple-repositories@beecbe897cf5ed7f3de5a791a3f2d70102fe7c25 with: github_token: ${{ secrets.GH_TOKEN }} - patterns_to_include: .github/workflows/scripts,.github/workflows/automerge-for-humans-add-ready-to-merge-or-do-not-merge-label.yml,.github/workflows/add-good-first-issue-labels.yml,.github/workflows/automerge-for-humans-merging.yml,.github/workflows/automerge-for-humans-remove-ready-to-merge-label-on-edit.yml,.github/workflows/automerge-orphans.yml,.github/workflows/automerge.yml,.github/workflows/autoupdate.yml,.github/workflows/help-command.yml,.github/workflows/issues-prs-notifications.yml,.github/workflows/lint-pr-title.yml,.github/workflows/notify-tsc-members-mention.yml,.github/workflows/stale-issues-prs.yml,.github/workflows/welcome-first-time-contrib.yml,.github/workflows/release-announcements.yml + patterns_to_include: .github/workflows/scripts,.github/workflows/automerge-for-humans-add-ready-to-merge-or-do-not-merge-label.yml,.github/workflows/add-good-first-issue-labels.yml,.github/workflows/automerge-for-humans-merging.yml,.github/workflows/automerge-for-humans-remove-ready-to-merge-label-on-edit.yml,.github/workflows/automerge-orphans.yml,.github/workflows/automerge.yml,.github/workflows/autoupdate.yml,.github/workflows/help-command.yml,.github/workflows/issues-prs-notifications.yml,.github/workflows/lint-pr-title.yml,.github/workflows/notify-tsc-members-mention.yml,.github/workflows/stale-issues-prs.yml,.github/workflows/welcome-first-time-contrib.yml,.github/workflows/release-announcements.yml,.github/workflows/please-take-a-look-command.yml committer_username: asyncapi-bot committer_email: info@asyncapi.io commit_message: "ci: update of files from global .github repo"