···11+---
22+"@opennextjs/cloudflare": patch
33+---
44+55+When running `wrangler deploy` add a `OPEN_NEXT_DEPLOY` environment variable to let wrangler know that it is being run by open-next
+7
packages/cloudflare/src/cli/commands/deploy.ts
···5656 ],
5757 {
5858 logging: "all",
5959+ env: {
6060+ // If we are running the deploy command we set this OPEN_NEXT_DEPLOY environment variable
6161+ // to let `wrangler deploy` know that it is being run from open-next. We do this because
6262+ // otherwise `wrangler deploy` run in an open-next project would call
6363+ // `opennextjs-cloudflare deploy` (thus causing an unwanted recursion).
6464+ OPEN_NEXT_DEPLOY: "true",
6565+ },
5966 }
6067 );
6168}
+2
packages/cloudflare/src/cli/utils/run-wrangler.ts
···1313 environment?: string;
1414 configPath?: string;
1515 logging?: "all" | "error";
1616+ env?: Record<string, string>;
1617};
17181819/**
···7980 stdio: shouldPipeLogs ? ["ignore", "pipe", "pipe"] : "inherit",
8081 env: {
8182 ...process.env,
8383+ ...wranglerOpts.env,
8284 // `.env` files are handled by the adapter.
8385 // Wrangler would load `.env.<wrangler env>` while we should load `.env.<process.env.NEXTJS_ENV>`
8486 // See https://opennext.js.org/cloudflare/howtos/env-vars