fix: skip --env=production in deploy and allow Cloudflare secrets#43
fix: skip --env=production in deploy and allow Cloudflare secrets#43chitcommit merged 1 commit intomainfrom
Conversation
Deploy Worker failed because: 1. Reusable workflow defaults environment to 'production' but wrangler.toml has no [env.production] section — override to empty 2. CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID not in the workflow secret policy allowlist, failing Governance Gates Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
📝 WalkthroughWalkthroughExpands GitHub workflow configuration by adding two Cloudflare-related secrets (CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN) to the allowed workflow secrets allowlist and introduces an environment input parameter to the worker deployment workflow invocation interface. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/workflows/deploy-worker.yml (1)
18-20: LGTM - correct fix for flat wrangler.toml configuration.Setting
environment: ''correctly prevents the reusable workflow from passing--env=productionto wrangler, which would fail sincewrangler.tomldoesn't define an[env.production]section. The Worker still operates in production mode via theENVIRONMENT = "production"variable in[vars].Consider adding a brief comment to prevent future confusion:
,
📝 Optional: Add a clarifying comment
with: service_name: chittycommand + # Empty because wrangler.toml uses flat config without [env.*] sections environment: ''🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/deploy-worker.yml around lines 18 - 20, The workflow already sets environment: '' to avoid wrangler passing --env=production; add a brief inline comment next to the environment key explaining that an empty environment prevents the reusable workflow from adding --env=production and that production mode is still provided via the ENVIRONMENT var in [vars], so future maintainers won't revert this change; reference the keys service_name and environment in the comment for clarity.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In @.github/workflows/deploy-worker.yml:
- Around line 18-20: The workflow already sets environment: '' to avoid wrangler
passing --env=production; add a brief inline comment next to the environment key
explaining that an empty environment prevents the reusable workflow from adding
--env=production and that production mode is still provided via the ENVIRONMENT
var in [vars], so future maintainers won't revert this change; reference the
keys service_name and environment in the comment for clarity.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 6e83ef93-7adb-499c-84aa-6f42d279ffe1
📒 Files selected for processing (2)
.github/allowed-workflow-secrets.txt.github/workflows/deploy-worker.yml
Summary
environmentto empty string in deploy-worker.yml — wrangler.toml uses flat config, not[env.production]CLOUDFLARE_API_TOKENandCLOUDFLARE_ACCOUNT_IDto.github/allowed-workflow-secrets.txtso Governance Gates passFixes both deploy failures from PR #42 merge:
No environment found in configuration with name "production"(wrangler error)Disallowed workflow secret reference: CLOUDFLARE_API_TOKEN(governance gate)Test plan
🤖 Generated with Claude Code
Summary by CodeRabbit