Skip to content

Commit 2d50b31

Browse files
fix: skip missing-issue comments for bot PRs (hiero-ledger#1398)
Signed-off-by: Kushagra Kaushik <Kush@Kushagra-Kaushiks-Macbook-Pro.local> Signed-off-by: Kushagra Kaushik <kushagra.k25239@nst.rishihood.edu.in>
1 parent 62bdfe7 commit 2d50b31

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

.github/scripts/bot-pr-missing-linked-issue.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@ module.exports = async ({ github, context }) => {
2020
prData = prResponse.data;
2121
}
2222

23+
const authorType = prData.user?.type;
24+
const authorLogin = prData.user?.login;
25+
26+
if (authorType === "Bot" || authorLogin?.endsWith('[bot]')){
27+
console.log(`Skipping comment: PR created by bot (${authorLogin})`);
28+
return;
29+
}
30+
2331
const body = prData.body || "";
2432
const regex = /\bFixes\s*:?\s*(#\d+)(\s*,\s*#\d+)*/i;
2533

@@ -81,5 +89,4 @@ module.exports = async ({ github, context }) => {
8189
console.error('Repository:', `${context.repo.owner}/${context.repo.repo}`);
8290
throw error;
8391
}
84-
};
85-
92+
};

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 bot-pr-missing-linked-issue to skip commenting on pull requests created by automated bots. (#1382)
172173

173174
### Breaking Change
174175

0 commit comments

Comments
 (0)