소스 검색

fix: prevent Claude agent execution on closed issues #23

Added explicit state check to filter out closed issues for both
'issues' and 'issue_comment' events. This provides defense-in-depth
protection alongside the existing filterActions whitelist.

Changes:
- Added issue.state check in commandExecutor.js
- Skips command execution when issue state is 'closed'
- Applies to both 'issues' and 'issue_comment' event types
- Logs skip reason for debugging

This ensures the Claude agent will never be triggered on closed
issues, even if the action passes the filterActions whitelist (e.g.,
when assigning a closed issue to Claude).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Claude 9 달 전
부모
커밋
fc082807c6
1개의 변경된 파일10개의 추가작업 그리고 0개의 파일을 삭제
  1. 10 0
      src/commandExecutor.js

+ 10 - 0
src/commandExecutor.js

@@ -298,6 +298,16 @@ export class CommandExecutor {
       }
     }
 
+    // Skip execution if issue is closed (for issue and issue_comment events)
+    if (eventType === 'issues' || eventType === 'issue_comment') {
+      const issueState = payload.issue?.state || '';
+      if (issueState === 'closed') {
+        const commandName = config.name || config.command || 'unknown';
+        logger.info(`Skipping command '${commandName}' - issue state is 'closed'`);
+        return null;
+      }
+    }
+
     let command, args, type;
 
     if (isNewFormat) {