From e5dda98b4a9fb75ab4e280152bd38d7833986892 Mon Sep 17 00:00:00 2001 From: Yusuf Ali Date: Sun, 14 Dec 2025 12:18:35 +0000 Subject: [PATCH] fix(test): enable testable endpoints --- .github/workflows/test.yml | 3 ++- dist/index.js | 19 ++++++++++++++----- index.js | 19 ++++++++++++++----- 3 files changed, 30 insertions(+), 11 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 212bedc..776740c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,4 +19,5 @@ jobs: id: test uses: ./ with: - debug: 'true' \ No newline at end of file + debug: 'true' + bot_route: 'random' \ No newline at end of file diff --git a/dist/index.js b/dist/index.js index 9109fa5..008a20a 100644 --- a/dist/index.js +++ b/dist/index.js @@ -32877,17 +32877,26 @@ async function run() { const githubToken = process.env.GITHUB_TOKEN; if (!commentBody) { - core.setFailed('No comment body found in the event payload'); - return; + if (!debug) { + core.setFailed('No comment body found in the event payload'); + return; + } + + core.info('No comment body found in the event payload, continuing because debug is enabled'); } - const task = + let task = (await fetchFirstIssueComment(repoName, issueNumber, githubToken, serverUrl)) || sanitizeTask(commentBody); if (!task) { - core.setFailed('Unable to determine the task to send to the agent'); - return; + if (!debug) { + core.setFailed('Unable to determine the task to send to the agent'); + return; + } + + core.info('Unable to determine the task, using debug placeholder'); + task = '[debug] empty task'; } const requestPayload = { diff --git a/index.js b/index.js index b08aa0f..fa28355 100644 --- a/index.js +++ b/index.js @@ -45,17 +45,26 @@ async function run() { const githubToken = process.env.GITHUB_TOKEN; if (!commentBody) { - core.setFailed('No comment body found in the event payload'); - return; + if (!debug) { + core.setFailed('No comment body found in the event payload'); + return; + } + + core.info('No comment body found in the event payload, continuing because debug is enabled'); } - const task = + let task = (await fetchFirstIssueComment(repoName, issueNumber, githubToken, serverUrl)) || sanitizeTask(commentBody); if (!task) { - core.setFailed('Unable to determine the task to send to the agent'); - return; + if (!debug) { + core.setFailed('Unable to determine the task to send to the agent'); + return; + } + + core.info('Unable to determine the task, using debug placeholder'); + task = '[debug] empty task'; } const requestPayload = {