fix(test): enable testable endpoints
All checks were successful
Unit Tests / unittest (push) Successful in 38s
All checks were successful
Unit Tests / unittest (push) Successful in 38s
This commit is contained in:
3
.github/workflows/test.yml
vendored
3
.github/workflows/test.yml
vendored
@@ -19,4 +19,5 @@ jobs:
|
|||||||
id: test
|
id: test
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
debug: 'true'
|
debug: 'true'
|
||||||
|
bot_route: 'random'
|
||||||
19
dist/index.js
vendored
19
dist/index.js
vendored
@@ -32877,17 +32877,26 @@ async function run() {
|
|||||||
const githubToken = process.env.GITHUB_TOKEN;
|
const githubToken = process.env.GITHUB_TOKEN;
|
||||||
|
|
||||||
if (!commentBody) {
|
if (!commentBody) {
|
||||||
core.setFailed('No comment body found in the event payload');
|
if (!debug) {
|
||||||
return;
|
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)) ||
|
(await fetchFirstIssueComment(repoName, issueNumber, githubToken, serverUrl)) ||
|
||||||
sanitizeTask(commentBody);
|
sanitizeTask(commentBody);
|
||||||
|
|
||||||
if (!task) {
|
if (!task) {
|
||||||
core.setFailed('Unable to determine the task to send to the agent');
|
if (!debug) {
|
||||||
return;
|
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 = {
|
const requestPayload = {
|
||||||
|
|||||||
19
index.js
19
index.js
@@ -45,17 +45,26 @@ async function run() {
|
|||||||
const githubToken = process.env.GITHUB_TOKEN;
|
const githubToken = process.env.GITHUB_TOKEN;
|
||||||
|
|
||||||
if (!commentBody) {
|
if (!commentBody) {
|
||||||
core.setFailed('No comment body found in the event payload');
|
if (!debug) {
|
||||||
return;
|
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)) ||
|
(await fetchFirstIssueComment(repoName, issueNumber, githubToken, serverUrl)) ||
|
||||||
sanitizeTask(commentBody);
|
sanitizeTask(commentBody);
|
||||||
|
|
||||||
if (!task) {
|
if (!task) {
|
||||||
core.setFailed('Unable to determine the task to send to the agent');
|
if (!debug) {
|
||||||
return;
|
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 = {
|
const requestPayload = {
|
||||||
|
|||||||
Reference in New Issue
Block a user