Skip to content

Commit 61eda4f

Browse files
authored
fix: prevent duplicate issue reminder comments and update message (hiero-ledger#1399)
Signed-off-by: Adityarya11 <arya050411@gmail.com> Signed-off-by: notsogod <149138960+Adityarya11@users.noreply.github.com>
1 parent 2d50b31 commit 61eda4f

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

.github/scripts/bot-issue-reminder-no-pr.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ set -euo pipefail
1010
REPO="${REPO:-${GITHUB_REPOSITORY:-}}"
1111
DAYS="${DAYS:-7}"
1212
DRY_RUN="${DRY_RUN:-false}"
13+
MARKER='<!-- issue-reminder-bot -->'
1314

1415
# Normalize DRY_RUN to "true" or "false"
1516
if [[ "$DRY_RUN" == "true" || "$DRY_RUN" == "yes" || "$DRY_RUN" == "1" ]]; then
@@ -72,7 +73,7 @@ echo "$ALL_ISSUES_JSON" | jq -c '.' | while read -r ISSUE_JSON; do
7273

7374
# Check if this issue already has a reminder comment from ReminderBot
7475
EXISTING_COMMENT=$(gh api "repos/$REPO/issues/$ISSUE/comments" \
75-
--jq ".[] | select(.user.login == \"github-actions[bot]\") | select(.body | contains(\"ReminderBot\")) | .id" \
76+
--jq ".[] | select(.user.login == \"github-actions[bot]\") | select(.body | contains(\"<!-- issue-reminder-bot -->\")) | .id" \
7677
| head -n1)
7778

7879
if [ -n "$EXISTING_COMMENT" ]; then
@@ -136,10 +137,12 @@ echo "$ALL_ISSUES_JSON" | jq -c '.' | while read -r ISSUE_JSON; do
136137

137138
ASSIGNEE_MENTIONS=$(echo "$ISSUE_JSON" | jq -r '.assignees[].login | "@" + .' | xargs)
138139

139-
MESSAGE="Hi ${ASSIGNEE_MENTIONS} 👋
140+
MESSAGE="${MARKER}
141+
Hi ${ASSIGNEE_MENTIONS} 👋
140142
141143
This issue has been assigned but no pull request has been created yet.
142144
Are you still planning on working on it?
145+
If you are, please create a draft PR linked to this issue so we know you are working on it.
143146
144147
From the Python SDK Team"
145148

@@ -155,4 +158,4 @@ done
155158

156159
echo "------------------------------------------------------------"
157160
echo " Issue Reminder Bot (No PR) complete."
158-
echo "------------------------------------------------------------"
161+
echo "------------------------------------------------------------"

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ This changelog is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.
169169
- Fixed `cron-check-broken-links.yml` string parsing issue in context input `dry_run` (#1235)
170170
- Flaky tests by disabling TLS in mock Hedera nodes in `mock_server.py`
171171
- Fixed LinkBot permission issue for fork PRs by changing trigger to pull_request_target and adding proper permissions.
172+
- Fixed duplicate comment prevention in issue reminder bot by adding hidden HTML marker for reliable comment detection (.github/scripts/bot-issue-reminder-no-pr.sh) (#1372)
172173
- Fixed bot-pr-missing-linked-issue to skip commenting on pull requests created by automated bots. (#1382)
173174

174175
### Breaking Change

0 commit comments

Comments
 (0)