Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 4 additions & 15 deletions .github/issue-assistant/src/security.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ async function validateRequest({
context,
maxInputLength,
rateLimitPerHour,
maxBotResponses,
customInjectionPatterns,
customSuspiciousPatterns
}) {
Expand Down Expand Up @@ -226,21 +227,9 @@ async function validateRequest({
errors.push('Rate limit exceeded');
}

if (comment) {
const { data: comments } = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue.number
});

const botComments = comments.filter(c =>
c.body && c.body.includes('<!-- msdo-issue-assistant -->')
);

if (botComments.length >= 3) {
errors.push('Maximum bot responses reached');
}
}
// Note: Bot response count per issue is now validated in the conversation-state step
// of the workflow, not here. This avoids redundant validation and keeps state
// management centralized.

return {
shouldRespond: errors.length === 0,
Expand Down
Loading
Loading