From b07b29fac4a68c76179d12affa234c9e4ef6f97b Mon Sep 17 00:00:00 2001 From: Marko Baricevic Date: Wed, 25 Sep 2024 14:55:38 +0200 Subject: [PATCH 1/2] pr reminder action --- .github/workflows/pr-reminder.yml | 51 +++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/pr-reminder.yml diff --git a/.github/workflows/pr-reminder.yml b/.github/workflows/pr-reminder.yml new file mode 100644 index 000000000..88332781e --- /dev/null +++ b/.github/workflows/pr-reminder.yml @@ -0,0 +1,51 @@ +name: PR Review Reminder + +on: + schedule: + - cron: '0 9 * * 1-5' # Every weekday at 9:00 AM UTC + pull_request: + +permissions: + pull-requests: read + +jobs: + pr-review: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: List open pull requests using GitHub Script + uses: actions/github-script@v7 + id: pr-list + with: + script: | + const { data: pullRequests } = await github.rest.pulls.list({ + owner: context.repo.owner, + repo: context.repo.repo, + state: 'open', + }); + let table = ''; + pullRequests.forEach(pr => { + const assignees = pr.assignees.length > 0 ? `Assignees: ${pr.assignees.map(assignee => assignee.login).join(', ')}` : 'No assignees'; + table += pr.draft ? '' : ` + Title: ${pr.title} + Link: <${pr.html_url}> + Assigness: ${assignees} + `; + }); + return table; + - name: Send Slack Reminder + if: steps.pr-list.outputs.result != '' + uses: rtCamp/action-slack-notify@v2.3.0 + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + SLACK_CHANNEL: pr-github + SLACK_USERNAME: PR-Reminder + MSG_MINIMAL: true + SLACK_ICON_EMOJI: ":think:" + SLACK_COLOR: good + SLACKIFY_MARKDOWN: true + SLACK_TITLE: Daily Pull Request Review Reminder + SLACK_MESSAGE: | + ${{ steps.pr-list.outputs.result }} From 101a1738f825bc64e9549d6687e6624c7a596ff2 Mon Sep 17 00:00:00 2001 From: Marko Baricevic Date: Wed, 25 Sep 2024 15:00:16 +0200 Subject: [PATCH 2/2] remove pr send --- .github/workflows/pr-reminder.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/pr-reminder.yml b/.github/workflows/pr-reminder.yml index 88332781e..06c58db66 100644 --- a/.github/workflows/pr-reminder.yml +++ b/.github/workflows/pr-reminder.yml @@ -3,7 +3,6 @@ name: PR Review Reminder on: schedule: - cron: '0 9 * * 1-5' # Every weekday at 9:00 AM UTC - pull_request: permissions: pull-requests: read