mirror of
https://github.com/cloudflare/wrangler-action.git
synced 2024-11-28 12:44:45 +01:00
3f40637a1c
Some of the stderr, stdout, info & groupings can be a little noisy for some users and use cases. This feature allows for a option to be passed 'quiet: true' this would significantly reduce the noise. There will still be output that lets the user know Wrangler Installed and Wrangler Action completed successfully. Any failure status will still be output to the user as well, to prevent silent failures. resolves #142
20 lines
469 B
JavaScript
20 lines
469 B
JavaScript
const { execSync } = require("child_process");
|
|
|
|
function workerHealthCheck() {
|
|
const url =
|
|
"https://wrangler-action-test.devprod-testing7928.workers.dev/secret-health-check";
|
|
|
|
const buffer = execSync(`curl ${url}`);
|
|
|
|
const response = buffer.toString();
|
|
|
|
if (response.includes("OK")) {
|
|
console.log(`Status: Worker is up! Response: ${response}`);
|
|
} else {
|
|
throw new Error(`Worker is down! Response: ${response}`);
|
|
}
|
|
|
|
return response;
|
|
}
|
|
|
|
workerHealthCheck();
|