diff --git a/.github/scripts/bot-pr-missing-linked-issue.js b/.github/scripts/bot-pr-missing-linked-issue.js index 4e0726f08..d7ed988e2 100644 --- a/.github/scripts/bot-pr-missing-linked-issue.js +++ b/.github/scripts/bot-pr-missing-linked-issue.js @@ -20,6 +20,14 @@ module.exports = async ({ github, context }) => { prData = prResponse.data; } + const authorType = prData.user?.type; + const authorLogin = prData.user?.login; + + if (authorType === "Bot" || authorLogin?.endsWith('[bot]')){ + console.log(`Skipping comment: PR created by bot (${authorLogin})`); + return; + } + const body = prData.body || ""; const regex = /\bFixes\s*:?\s*(#\d+)(\s*,\s*#\d+)*/i; @@ -81,5 +89,4 @@ module.exports = async ({ github, context }) => { console.error('Repository:', `${context.repo.owner}/${context.repo.repo}`); throw error; } -}; - +}; \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index d086fe355..4a7e630e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -169,6 +169,7 @@ This changelog is based on [Keep a Changelog](https://keepachangelog.com/en/1.1. - Fixed `cron-check-broken-links.yml` string parsing issue in context input `dry_run` (#1235) - Flaky tests by disabling TLS in mock Hedera nodes in `mock_server.py` - Fixed LinkBot permission issue for fork PRs by changing trigger to pull_request_target and adding proper permissions. +- Fixed bot-pr-missing-linked-issue to skip commenting on pull requests created by automated bots. (#1382) ### Breaking Change