Skip to content

Commit e777dcf

Browse files
committed
Add weekly reminder to respond to PRs
1 parent 6a27ea9 commit e777dcf

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
name: Friday PR Author Reminder
3+
4+
on:
5+
schedule:
6+
# Every Friday at 13:00 UTC
7+
- cron: '0 13 * * 5'
8+
workflow_dispatch:
9+
10+
jobs:
11+
remind-authors:
12+
runs-on: ubuntu-latest
13+
if: github.repository == 'stackhpc/stackhpc-kayobe-config'
14+
permissions:
15+
pull-requests: write
16+
17+
steps:
18+
- name: Fetch open PRs and remind authors
19+
env:
20+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21+
run: |
22+
# Fetch open PRs with the specific label in JSON format. Extract number and author username
23+
prs=$(gh pr list --state open --label "waiting-author-response" --json number,author --jq '.[] | "\(.number),\(.author.login)"')
24+
25+
# However unlikely, exit if none found
26+
if [ -z "$prs" ]; then
27+
echo "No open PRs found with the 'waiting-author-response' label."
28+
exit 0
29+
fi
30+
31+
# Loop through the PRs and post reminder
32+
echo "$prs" | while IFS=, read -r pr_number author; do
33+
echo "Sending reminder to @$author on PR #$pr_number..."
34+
35+
gh pr comment "$pr_number" --body "Happy Friday @$author, this is a friendly reminder that this PR is waiting for your changes or response. Please take a look when you have a moment!
36+
37+
**Note:** Once your changes are ready, remove the \`waiting-author-response\` label and add the \`waiting-review\` label."
38+
done

0 commit comments

Comments
 (0)