mirror of
https://github.com/DeterminateSystems/magic-nix-cache-action.git
synced 2024-12-27 01:30:35 +01:00
Fail when workflow finish hook fails
This commit is contained in:
parent
79ca9d8642
commit
aa46387b46
3 changed files with 13 additions and 1 deletions
5
dist/index.js
generated
vendored
5
dist/index.js
generated
vendored
|
@ -95023,6 +95023,11 @@ var MagicNixCacheAction = class {
|
||||||
core.debug(`about to post to localhost`);
|
core.debug(`about to post to localhost`);
|
||||||
const hostAndPort = inputs_exports.getString("listen");
|
const hostAndPort = inputs_exports.getString("listen");
|
||||||
const res = await this.client.post(`http://${hostAndPort}/api/workflow-finish`).json();
|
const res = await this.client.post(`http://${hostAndPort}/api/workflow-finish`).json();
|
||||||
|
if (res.status !== 200) {
|
||||||
|
this.failInStrictMode(
|
||||||
|
`Failed to trigger workflow finish hook; expected HTTP status 200 from POST to /api/workflow-finish but got ${res.status} instead`
|
||||||
|
);
|
||||||
|
}
|
||||||
core.debug(`back from post: ${res}`);
|
core.debug(`back from post: ${res}`);
|
||||||
} finally {
|
} finally {
|
||||||
core.debug(`unwatching the daemon log`);
|
core.debug(`unwatching the daemon log`);
|
||||||
|
|
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
|
@ -310,6 +310,13 @@ class MagicNixCacheAction {
|
||||||
const res: Response = await this.client
|
const res: Response = await this.client
|
||||||
.post(`http://${hostAndPort}/api/workflow-finish`)
|
.post(`http://${hostAndPort}/api/workflow-finish`)
|
||||||
.json();
|
.json();
|
||||||
|
|
||||||
|
if (res.status !== 200) {
|
||||||
|
this.failInStrictMode(
|
||||||
|
`Failed to trigger workflow finish hook; expected HTTP status 200 from POST to /api/workflow-finish but got ${res.status} instead`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
actionsCore.debug(`back from post: ${res}`);
|
actionsCore.debug(`back from post: ${res}`);
|
||||||
} finally {
|
} finally {
|
||||||
actionsCore.debug(`unwatching the daemon log`);
|
actionsCore.debug(`unwatching the daemon log`);
|
||||||
|
|
Loading…
Reference in a new issue