mirror of
https://github.com/cloudflare/wrangler-action.git
synced 2024-11-22 10:03:24 +01:00
edb2a58814
* Removes dependencies such as Docker, decreasing spin-up time * Adds community-requested features, including bulk secrets API utilization from Wrangler * Fixes CI/CD * Adds testing * Improves command implementation * Begins using Node for the Action engine/runner * Openly discusses all changes with the community GitHub Discussions opened and Issues monitored BREAKING CHANGES: * Docker is no longer a dependency * Wrangler v1 is no longer supported Additional related Internal tickets: Major Version Default: https://jira.cfdata.org/browse/DEVX-632 Rewrite Project: DEVX-804,802,800,632
26 lines
527 B
TypeScript
26 lines
527 B
TypeScript
type Env = {
|
|
SECRET1?: string;
|
|
SECRET2?: string;
|
|
};
|
|
|
|
export default {
|
|
fetch(request: Request, env: Env) {
|
|
const url = new URL(request.url);
|
|
|
|
if (url.pathname === "/secret-health-check") {
|
|
const { SECRET1, SECRET2 } = env;
|
|
|
|
if (SECRET1 !== "SECRET_1_VALUE" || SECRET2 !== "SECRET_2_VALUE") {
|
|
throw new Error("SECRET1 or SECRET2 is not defined");
|
|
}
|
|
|
|
return new Response("OK");
|
|
}
|
|
|
|
// @ts-expect-error
|
|
return Response.json({
|
|
...request,
|
|
headers: Object.fromEntries(request.headers),
|
|
});
|
|
},
|
|
};
|