Skip to content

Skip Cloudflare Pages deploy when API token is not configured#4515

Merged
shai-almog merged 1 commit intomasterfrom
codex/fix-ci-process-for-cloudflare-upload-vgewib
Feb 13, 2026
Merged

Skip Cloudflare Pages deploy when API token is not configured#4515
shai-almog merged 1 commit intomasterfrom
codex/fix-ci-process-for-cloudflare-upload-vgewib

Conversation

@shai-almog
Copy link
Collaborator

Motivation

  • Wrangler fails in non-interactive CI when CLOUDFLARE_API_TOKEN is empty, causing the pages deploy step to hard-fail.
  • The workflow should avoid invoking wrangler when no API token is present to prevent spurious CI failures.
  • Repositories sometimes use alternative secret names, so the deploy logic should accept CF_* fallbacks for token, account, and project name.

Description

  • Add a Check Cloudflare deploy credentials step that emits a warning (instead of failing) when neither CLOUDFLARE_API_TOKEN nor CF_API_TOKEN is set for main/master push events.
  • Require a non-empty token in the Deploy to Cloudflare Pages step if condition and export CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID in the step env using fallbacks to CF_API_TOKEN and CF_ACCOUNT_ID.
  • Update action inputs and the --project-name argument to include fallbacks (apiToken, accountId, and vars/secrets including CF_PAGES_PROJECT_NAME) so the action works across different secret naming conventions.

Testing

  • Parsed the updated workflow YAML with ruby -e "require 'yaml'; YAML.load_file('.github/workflows/website-docs.yml'); puts 'ok'", which succeeded and printed ok.

Codex Task

@shai-almog shai-almog merged commit 320d531 into master Feb 13, 2026
6 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant