Fix HTTP response stringify issue

This commit is contained in:
Luc Perkins 2024-05-20 09:25:51 -03:00
parent edc61c4d5a
commit a8b68ff5ba
No known key found for this signature in database
GPG Key ID: 16DB1108FB591835
3 changed files with 7 additions and 9 deletions

6
dist/index.js generated vendored
View File

@ -94996,15 +94996,13 @@ var MagicNixCacheAction = class {
try {
core.debug(`Indicating workflow start`);
const hostAndPort = inputs_exports.getString("listen");
const res = await this.client.post(
`http://${hostAndPort}/api/workflow-start`
);
const res = await this.client.post(`http://${hostAndPort}/api/workflow-start`).json();
if (res.statusCode !== 200) {
this.failInStrictMode(
`Failed to trigger workflow start hook. Expected status 200 but got ${res.statusCode}`
);
}
core.debug(`back from post: ${JSON.stringify(res)}`);
core.debug(`back from post: ${JSON.stringify(res.body)}`);
} catch (e) {
core.info(`Error marking the workflow as started:`);
core.info((0,external_node_util_.inspect)(e));

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

View File

@ -274,9 +274,9 @@ class MagicNixCacheAction {
try {
actionsCore.debug(`Indicating workflow start`);
const hostAndPort = inputs.getString("listen");
const res: Response<string> = await this.client.post(
`http://${hostAndPort}/api/workflow-start`,
);
const res: Response<string> = await this.client
.post(`http://${hostAndPort}/api/workflow-start`)
.json();
if (res.statusCode !== 200) {
this.failInStrictMode(
@ -284,7 +284,7 @@ class MagicNixCacheAction {
);
}
actionsCore.debug(`back from post: ${JSON.stringify(res)}`);
actionsCore.debug(`back from post: ${JSON.stringify(res.body)}`);
} catch (e) {
actionsCore.info(`Error marking the workflow as started:`);
actionsCore.info(inspect(e));