Skip to content

Fix preview workflow github-token fallback - #206

Merged
kentcdodds merged 1 commit into
mainfrom
cursor/fix-preview-token-fallback-e006
Apr 18, 2026
Merged

kentcdodds merged 1 commit into
mainfrom
cursor/fix-preview-token-fallback-e006

Conversation

@kentcdodds

@kentcdodds kentcdodds commented Apr 18, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • make the preview environment cleanup github-token fall back to ${{ github.token }} when PREVIEW_ENVIRONMENT_ADMIN_TOKEN is unset
  • preserve the existing script-level hasAdminToken guard so the workflow now reaches the intended actionable error message instead of failing during action initialization

Testing

  • git diff --check
  • python YAML parse and expression spot-check for the updated github-token field
  • verified against actions/github-script@v8.0.0 source that github-token is required before the script body runs
Open in Web Open in Cursor 

Summary by CodeRabbit

  • Chores
    • Enhanced preview deployment process reliability through improved authentication fallback handling.

Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
@coderabbitai

coderabbitai Bot commented Apr 18, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8dea4fdd-adf5-496b-9d5f-afe047c77d03

📥 Commits

Reviewing files that changed from the base of the PR and between fd3c491 and 5c4fa98.

📒 Files selected for processing (1)
  • .github/workflows/preview.yml

📝 Walkthrough

Walkthrough

Updated GitHub workflow configuration to conditionally use a fallback GitHub token in the preview deployment process. The github-token input now uses secrets.PREVIEW_ENVIRONMENT_ADMIN_TOKEN || github.token, allowing the workflow to fall back to the default token when the dedicated secret is unavailable.

Changes

Cohort / File(s) Summary
Workflow Token Fallback
.github/workflows/preview.yml
Added conditional fallback to github.token for github-token input in actions/github-script@v8.0.0, enabling the workflow to proceed when the dedicated preview admin secret is not configured.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

Poem

🐰 A token's journey, now with grace,
When secrets hide, we find our place—
A fallback whispers, soft and true,
github.token shines bright and new! 🎉

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Fix preview workflow github-token fallback' directly describes the main change: implementing a fallback mechanism for the github-token in the preview workflow.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cursor/fix-preview-token-fallback-e006

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@kentcdodds
kentcdodds marked this pull request as ready for review April 18, 2026 14:52
@github-actions

Copy link
Copy Markdown
Contributor

🔎 Preview deployed: https://kody-pr-206.kentcdodds.workers.dev

Worker: kody-pr-206
D1: kody-pr-206-db
KV: kody-pr-206-oauth-kv

Mocks:

@kentcdodds
kentcdodds merged commit 7739200 into main Apr 18, 2026
16 checks passed
@kentcdodds
kentcdodds deleted the cursor/fix-preview-token-fallback-e006 branch April 18, 2026 15:03
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