Sync switch config after strategy changes#32
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1192c30b37
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| CONFIRM_APPLY: ${{ inputs.confirm_apply }} | ||
| PLATFORM_SYNC_WORKFLOW: ${{ inputs.platform_sync_workflow }} | ||
| STRATEGY_SWITCH_CONSOLE_URL: ${{ vars.STRATEGY_SWITCH_CONSOLE_URL }} | ||
| STRATEGY_SWITCH_SYNC_TOKEN: ${{ secrets.STRATEGY_SWITCH_SYNC_TOKEN || secrets.RUNTIME_SETTINGS_GH_TOKEN }} |
There was a problem hiding this comment.
Use the Worker sync token for workflow callbacks
When STRATEGY_SWITCH_CONSOLE_URL is configured but the new STRATEGY_SWITCH_SYNC_TOKEN secret is omitted, this fallback sends RUNTIME_SETTINGS_GH_TOKEN to /api/internal/sync-account-default. The Worker validates against env.STRATEGY_SWITCH_SYNC_TOKEN || env.RUNTIME_SETTINGS_DISPATCH_TOKEN, and the README documents the Worker-side default as RUNTIME_SETTINGS_DISPATCH_TOKEN, so the documented optional-secret setup will get a 401 after applying variables and the workflow will fail instead of syncing account defaults. Either require the sync secret explicitly here or fall back to the same dispatch token value the Worker expects.
Useful? React with 👍 / 👎.
Summary
Validation