From 6e9326cb330f272c31c987191c9b366ca8f3ad3b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 11 Feb 2026 07:08:25 +0000 Subject: [PATCH 1/5] Initial plan From 9ae42eb26f88e928edc222505a789182ec5addb2 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 11 Feb 2026 07:10:57 +0000 Subject: [PATCH 2/5] Fix validation logic to properly check only new content Co-authored-by: DimaBir <28827735+DimaBir@users.noreply.github.com> --- .github/workflows/issue-assistant.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/issue-assistant.yml b/.github/workflows/issue-assistant.yml index 0e2e6920..27c6cbfc 100644 --- a/.github/workflows/issue-assistant.yml +++ b/.github/workflows/issue-assistant.yml @@ -34,7 +34,7 @@ jobs: }} outputs: - should_respond: ${{ steps.conversation-state.outputs.should_respond }} + should_respond: ${{ steps.conversation-state.outputs.should_respond == 'true' && steps.validation.outputs.validation_passed == 'true' }} conversation_state: ${{ steps.conversation-state.outputs.state }} conversation_history: ${{ steps.conversation-state.outputs.history }} sanitized_content: ${{ steps.validation.outputs.sanitized_content }} @@ -246,7 +246,11 @@ jobs: const fs = require('fs'); const path = require('path'); - // Get the latest user content to validate + // IMPORTANT: For issue_comment events, we validate ONLY the new comment content. + // For issues events (new issue), we validate the issue body. + // This ensures we don't re-validate the original issue body on subsequent comments. + // If the original issue had validation issues but a new comment is clean, we allow it. + // If a new comment has validation issues, we block it even if the issue body was clean. const isComment = context.eventName === 'issue_comment'; const rawContent = isComment ? context.payload.comment.body @@ -256,7 +260,7 @@ jobs: if (!fs.existsSync(securityPath)) { console.log('::warning::security.js not found'); - core.setOutput('should_respond', 'true'); + core.setOutput('validation_passed', 'true'); core.setOutput('sanitized_content', rawContent.slice(0, parseInt(process.env.MAX_INPUT_LENGTH))); core.setOutput('issue_type', 'unknown'); return; @@ -286,12 +290,12 @@ jobs: customInjectionPatterns: injectionPatterns }); - core.setOutput('should_respond', result.shouldRespond); + core.setOutput('validation_passed', result.shouldRespond.toString()); core.setOutput('sanitized_content', result.sanitizedContent || ''); core.setOutput('issue_type', result.issueType || 'unknown'); if (!result.shouldRespond) { - console.log('Validation failed:', result.errors); + console.log('Validation failed for new content:', result.errors); } respond-with-ai: From cf524582d3e89a41b0804ca708b95c63de7d9f39 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 11 Feb 2026 07:12:34 +0000 Subject: [PATCH 3/5] Use explicit string conversion for validation output Co-authored-by: DimaBir <28827735+DimaBir@users.noreply.github.com> --- .github/workflows/issue-assistant.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/issue-assistant.yml b/.github/workflows/issue-assistant.yml index 27c6cbfc..39164b97 100644 --- a/.github/workflows/issue-assistant.yml +++ b/.github/workflows/issue-assistant.yml @@ -290,7 +290,7 @@ jobs: customInjectionPatterns: injectionPatterns }); - core.setOutput('validation_passed', result.shouldRespond.toString()); + core.setOutput('validation_passed', result.shouldRespond ? 'true' : 'false'); core.setOutput('sanitized_content', result.sanitizedContent || ''); core.setOutput('issue_type', result.issueType || 'unknown'); From 9e8976af2c57c9766726f243e35a0964f7cea4b3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 11 Feb 2026 07:13:20 +0000 Subject: [PATCH 4/5] Make should_respond output explicitly return string Co-authored-by: DimaBir <28827735+DimaBir@users.noreply.github.com> --- .github/workflows/issue-assistant.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/issue-assistant.yml b/.github/workflows/issue-assistant.yml index 39164b97..4a452c76 100644 --- a/.github/workflows/issue-assistant.yml +++ b/.github/workflows/issue-assistant.yml @@ -34,7 +34,7 @@ jobs: }} outputs: - should_respond: ${{ steps.conversation-state.outputs.should_respond == 'true' && steps.validation.outputs.validation_passed == 'true' }} + should_respond: ${{ (steps.conversation-state.outputs.should_respond == 'true' && steps.validation.outputs.validation_passed == 'true') && 'true' || 'false' }} conversation_state: ${{ steps.conversation-state.outputs.state }} conversation_history: ${{ steps.conversation-state.outputs.history }} sanitized_content: ${{ steps.validation.outputs.sanitized_content }} From ed81afd0663c2aae8fed9d777d72de0efabed298 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 11 Feb 2026 07:14:11 +0000 Subject: [PATCH 5/5] Use ternary operator and improve validation log message Co-authored-by: DimaBir <28827735+DimaBir@users.noreply.github.com> --- .github/workflows/issue-assistant.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/issue-assistant.yml b/.github/workflows/issue-assistant.yml index 4a452c76..dea6b94e 100644 --- a/.github/workflows/issue-assistant.yml +++ b/.github/workflows/issue-assistant.yml @@ -34,7 +34,7 @@ jobs: }} outputs: - should_respond: ${{ (steps.conversation-state.outputs.should_respond == 'true' && steps.validation.outputs.validation_passed == 'true') && 'true' || 'false' }} + should_respond: ${{ (steps.conversation-state.outputs.should_respond == 'true' && steps.validation.outputs.validation_passed == 'true') ? 'true' : 'false' }} conversation_state: ${{ steps.conversation-state.outputs.state }} conversation_history: ${{ steps.conversation-state.outputs.history }} sanitized_content: ${{ steps.validation.outputs.sanitized_content }} @@ -295,7 +295,8 @@ jobs: core.setOutput('issue_type', result.issueType || 'unknown'); if (!result.shouldRespond) { - console.log('Validation failed for new content:', result.errors); + const contentType = isComment ? 'comment' : 'issue body'; + console.log(`Validation failed for ${contentType}:`, result.errors); } respond-with-ai: