mirror of
https://github.com/DeterminateSystems/magic-nix-cache-action.git
synced 2024-12-27 01:30:35 +01:00
Fix HTTP response stringify issue
This commit is contained in:
parent
edc61c4d5a
commit
a8b68ff5ba
3 changed files with 7 additions and 9 deletions
6
dist/index.js
generated
vendored
6
dist/index.js
generated
vendored
|
@ -94996,15 +94996,13 @@ var MagicNixCacheAction = class {
|
||||||
try {
|
try {
|
||||||
core.debug(`Indicating workflow start`);
|
core.debug(`Indicating workflow start`);
|
||||||
const hostAndPort = inputs_exports.getString("listen");
|
const hostAndPort = inputs_exports.getString("listen");
|
||||||
const res = await this.client.post(
|
const res = await this.client.post(`http://${hostAndPort}/api/workflow-start`).json();
|
||||||
`http://${hostAndPort}/api/workflow-start`
|
|
||||||
);
|
|
||||||
if (res.statusCode !== 200) {
|
if (res.statusCode !== 200) {
|
||||||
this.failInStrictMode(
|
this.failInStrictMode(
|
||||||
`Failed to trigger workflow start hook. Expected status 200 but got ${res.statusCode}`
|
`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) {
|
} catch (e) {
|
||||||
core.info(`Error marking the workflow as started:`);
|
core.info(`Error marking the workflow as started:`);
|
||||||
core.info((0,external_node_util_.inspect)(e));
|
core.info((0,external_node_util_.inspect)(e));
|
||||||
|
|
2
dist/index.js.map
generated
vendored
2
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
|
@ -274,9 +274,9 @@ class MagicNixCacheAction {
|
||||||
try {
|
try {
|
||||||
actionsCore.debug(`Indicating workflow start`);
|
actionsCore.debug(`Indicating workflow start`);
|
||||||
const hostAndPort = inputs.getString("listen");
|
const hostAndPort = inputs.getString("listen");
|
||||||
const res: Response<string> = await this.client.post(
|
const res: Response<string> = await this.client
|
||||||
`http://${hostAndPort}/api/workflow-start`,
|
.post(`http://${hostAndPort}/api/workflow-start`)
|
||||||
);
|
.json();
|
||||||
|
|
||||||
if (res.statusCode !== 200) {
|
if (res.statusCode !== 200) {
|
||||||
this.failInStrictMode(
|
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) {
|
} catch (e) {
|
||||||
actionsCore.info(`Error marking the workflow as started:`);
|
actionsCore.info(`Error marking the workflow as started:`);
|
||||||
actionsCore.info(inspect(e));
|
actionsCore.info(inspect(e));
|
||||||
|
|
Loading…
Reference in a new issue