mirror of
https://github.com/cloudflare/wrangler-action.git
synced 2024-11-24 10:54:46 +01:00
Additional Error Handling
Previously, we prevented any error logs from propagating too far to prevent leaking of any potentially sensitive information. However, this made it difficult for developers to debug their code. In this release, we have updated our error handling to allow for more error messaging from pre/post and custom commands. We still discourage the use of these commands for secrets or other sensitive information, but we believe this change will make it easier for developers to debug their code. Relates to #137
This commit is contained in:
parent
559dd40fe6
commit
74433eb31e
2 changed files with 22 additions and 2 deletions
10
.changeset/itchy-buses-grow.md
Normal file
10
.changeset/itchy-buses-grow.md
Normal file
|
@ -0,0 +1,10 @@
|
|||
---
|
||||
"wrangler-action": patch
|
||||
---
|
||||
|
||||
Additional Error Handling
|
||||
Previously, we prevented any error logs from propagating too far to prevent leaking of any potentially sensitive information. However, this made it difficult for developers to debug their code.
|
||||
|
||||
In this release, we have updated our error handling to allow for more error messaging from pre/post and custom commands. We still discourage the use of these commands for secrets or other sensitive information, but we believe this change will make it easier for developers to debug their code.
|
||||
|
||||
Relates to #137
|
14
src/index.ts
14
src/index.ts
|
@ -5,6 +5,7 @@ import {
|
|||
setFailed,
|
||||
endGroup,
|
||||
startGroup,
|
||||
error,
|
||||
} from "@actions/core";
|
||||
import { execSync, exec } from "node:child_process";
|
||||
import { existsSync } from "node:fs";
|
||||
|
@ -114,7 +115,10 @@ async function execCommands(commands: string[], cmdType: string) {
|
|||
});
|
||||
});
|
||||
|
||||
await Promise.all(arrPromises);
|
||||
await Promise.all(arrPromises).catch((result) => {
|
||||
error(`🚨 ${cmdType} Command failed`);
|
||||
setFailed(result);
|
||||
});
|
||||
endGroup();
|
||||
}
|
||||
|
||||
|
@ -264,10 +268,16 @@ async function wranglerCommands() {
|
|||
env: process.env,
|
||||
},
|
||||
);
|
||||
|
||||
info(result.stdout);
|
||||
return result;
|
||||
});
|
||||
await Promise.all(arrPromises);
|
||||
|
||||
await Promise.all(arrPromises).catch((result) => {
|
||||
error(`🚨 Command failed`);
|
||||
setFailed(result.stderr);
|
||||
});
|
||||
|
||||
endGroup();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue