Skip to content

Make Production deploy job secret-gated instead of hard-failing - #2

Draft
rahulkamilya with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-github-actions-production-job
Draft

Make Production deploy job secret-gated instead of hard-failing#2
rahulkamilya with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-github-actions-production-job

Conversation

Copilot AI commented Jun 20, 2026

Copy link
Copy Markdown

The Deploy workflow’s Production job failed whenever Cloudflare secrets were unset, causing main-branch deploy runs to fail before any deploy decisioning. This change converts missing-secret behavior from a hard error to an explicit skip path.

  • Secret presence as deploy gate

    • Added id: verify-secrets step output (has_secrets) based on CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID.
    • Replaced exit 1 failure behavior with a workflow warning when secrets are absent.
  • Conditional execution for deploy path

    • Added if: steps.verify-secrets.outputs.has_secrets == 'true' to:
      • Install
      • Build via OpenNext
      • Deploy to Cloudflare
    • Result: deploy runs proceed only when required Cloudflare credentials are configured; otherwise deployment steps are skipped cleanly.
- name: Verify Cloudflare secrets are present
  id: verify-secrets
  run: |
    if [ -n "${CLOUDFLARE_API_TOKEN:-}" ] && [ -n "${CLOUDFLARE_ACCOUNT_ID:-}" ]; then
      echo "has_secrets=true" >> "$GITHUB_OUTPUT"
    else
      echo "::warning::Cloudflare secrets are missing. Skipping production deploy."
      echo "has_secrets=false" >> "$GITHUB_OUTPUT"
    fi

- name: Deploy to Cloudflare
  if: steps.verify-secrets.outputs.has_secrets == 'true'
  run: npx wrangler deploy

Copilot AI changed the title [WIP] Fix failing GitHub Actions job "Production" Make Production deploy job secret-gated instead of hard-failing Jun 20, 2026
Copilot AI requested a review from rahulkamilya June 20, 2026 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants