File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change 3838
3939 echo "Unverified commits: $UNVERIFIED_COUNT"
4040
41+ EXISTING_BOT_COMMENT_COUNT=$(gh pr view $PR_NUMBER --repo $REPO --json comments | jq '[.comments[] | select(.author.login == "github-actions" and (.body | contains("[commit-verification-bot]")))] | length')
42+
43+ echo "Existing verification commit bot comments: $EXISTING_BOT_COMMENT_COUNT"
44+
4145 if [ "$UNVERIFIED_COUNT" -gt 0 ]; then
42- COMMENT=$(cat <<EOF
46+ if [ "$EXISTING_BOT_COMMENT_COUNT" -ge 1 ]; then
47+ echo "VerificationBot already commented. Skipping additional comments."
48+ else
49+ COMMENT=$(cat <<EOF
50+ [commit-verification-bot]
4351 Hi, this is VerificationBot.
4452 Your pull request cannot be merged as it has **unverified commits**.
4553 View your commit verification status : [Commits Tab]($COMMITS_URL).
5866 EOF
5967 )
6068
61- gh pr view $PR_NUMBER --repo $REPO --json comments --jq '.comments[].body' | grep -F "PythonBot" >/dev/null || \
62- (gh pr comment $PR_NUMBER --repo $REPO --body "$COMMENT" && echo "Comment added to PR #$PR_NUMBER")
69+ gh pr comment $PR_NUMBER --repo $REPO --body "$COMMENT"
70+ echo "Comment added to PR # $PR_NUMBER"
71+ fi
72+
73+ exit 1
6374 else
6475 echo "All commits in PR # $PR_NUMBER are verified."
6576 fi
66-
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ This changelog is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.
2020
2121### Added
2222
23+ - Add a limit of one comment for PR to the commit verification bot. [ #892 ]
2324- Removed ` actions/checkout@v4 ` from ` bot-verified-commits.yml `
2425- Add comprehensive documentation for ` ReceiptStatusError ` in ` docs/sdk_developers/training/receipt_status_error.md `
2526- Add practical example ` examples/errors/receipt_status_error.py ` demonstrating transaction error handling
You can’t perform that action at this time.
0 commit comments