Skip to content

Conversation

@kushagrakaushik
Copy link
Contributor

@kushagrakaushik kushagrakaushik commented Jan 8, 2026

Skip commenting on pull requests created by automated bots.

Fixes #1382

@coderabbitai
Copy link

coderabbitai bot commented Jan 8, 2026

📝 Walkthrough

Walkthrough

A guard was added to the bot-pr-missing-linked-issue script to skip processing pull requests created by automated bots (those with author type "Bot" or login ending with "[bot]"), preventing comment posting for such PRs. The changelog was updated to document this fix.

Changes

Cohort / File(s) Summary
Bot PR Script Guard
\.github/scripts/bot-pr-missing-linked-issue.js
Added early return guard to skip PR processing when author is a bot, preventing linked-issue comment logic from executing for bot-authored PRs
Changelog Update
CHANGELOG.md
Documented the new behavior of bot-pr-missing-linked-issue skipping automated bot PRs

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 3 | ❌ 2
❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR claims to fix #1381, which is a dependency bump for astral-sh/setup-uv. However, the actual code changes are unrelated to this dependency update objective. Ensure the PR addresses the dependency bump requirement from #1381 or update the linked issue reference to reflect the actual scope of this change.
Out of Scope Changes check ⚠️ Warning The changes to skip bot PR comments are unrelated to the #1381 objective of bumping astral-sh/setup-uv dependency version. Review whether this PR should be linked to #1381 or if it should address a different issue related to bot PR handling.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix: skip missing-issue comments for bot PRs' accurately describes the main change in the PR—adding logic to skip commenting on bot-created PRs.
Description check ✅ Passed The description 'Skip commenting on pull requests created by automated bots' is related to the changeset and clearly communicates the main objective.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 62bdfe7 and e093605.

📒 Files selected for processing (2)
  • .github/scripts/bot-pr-missing-linked-issue.js
  • CHANGELOG.md
🧰 Additional context used
📓 Path-based instructions (1)
.github/scripts/**/*.js

⚙️ CodeRabbit configuration file

.github/scripts/**/*.js: Review JavaScript scripts as long-lived automation code.

Scripts must remain:

  • Focused

  • Readable

  • Purpose-built

  • All context.payload fields MUST be validated

  • Free-form text MUST NOT be trusted

  • Dynamic code execution is prohibited

  • Avoid child_process.exec; prefer execFile if needed

  • All async operations MUST be wrapped in try/catch

  • Errors MUST include contextual metadata

  • Duplicate API calls MUST be avoided

  • Marker-based deduplication is required

  • Scripts MUST NOT assume write access

  • Permission failures MUST be handled gracefully

Files:

  • .github/scripts/bot-pr-missing-linked-issue.js
🔇 Additional comments (2)
CHANGELOG.md (1)

172-172: LGTM!

The changelog entry correctly documents the fix and follows the established format. It's appropriately placed in the Fixed section under Unreleased and references the correct issue.

.github/scripts/bot-pr-missing-linked-issue.js (1)

23-29: LGTM! Bot detection logic is sound and complies with coding guidelines.

The implementation correctly identifies bot-authored PRs using a dual check:

  • authorType === "Bot" for GitHub's official bot type
  • authorLogin?.endsWith('[bot]') for bot accounts like "dependabot[bot]"

The optional chaining safely handles edge cases where prData.user might be missing. The early return efficiently prevents unnecessary processing and comment posting for bot PRs, which aligns with the PR objectives.

As per coding guidelines, the implementation properly validates context.payload fields, uses safe logging practices, and leverages the existing try-catch block for error handling.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link

codecov bot commented Jan 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1398   +/-   ##
=======================================
  Coverage   92.44%   92.44%           
=======================================
  Files         139      139           
  Lines        8528     8528           
=======================================
  Hits         7884     7884           
  Misses        644      644           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@exploreriii exploreriii merged commit 2d50b31 into hiero-ledger:main Jan 8, 2026
20 of 21 checks passed
@exploreriii
Copy link
Contributor

Thank you so much for helping to reduce the spam :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Beginner]: Edit .github/scripts/bot-pr-missing-linked-issue.js to skip comments for dependabot or bots

2 participants