Skip to content

Fly deploy: auto-detect org slug for non-interactive apps create#39

Merged
dougdevitre merged 1 commit into
mainfrom
claude/fly-auto-detect-org
May 16, 2026
Merged

Fly deploy: auto-detect org slug for non-interactive apps create#39
dougdevitre merged 1 commit into
mainfrom
claude/fly-auto-detect-org

Conversation

@dougdevitre
Copy link
Copy Markdown
Owner

Why

After PR #38 unblocked flyctl on PATH, the deploy progressed to "Ensure Fly app exists" and failed with:

Error: org slug must be specified when not running interactively

fly apps create requires -o <org-slug> in CI (no TTY for the prompt).

Fix

Auto-detect the org slug from the token's accessible orgs. Your token is org-scoped, so fly orgs list -j returns exactly one org and we use that. Falls back to a FLY_ORG repo variable if auto-detect ever picks the wrong org (e.g., you switch to a multi-org token later).

The jq query handles both possible response shapes (array vs object) to survive flyctl version differences.

Test plan


Generated by Claude Code

`fly apps create` requires `-o <org-slug>` when no TTY is attached
(always in CI). The previous run failed with "org slug must be
specified when not running interactively".

Auto-detects from the token's accessible orgs (org-scoped tokens
return exactly one). Falls back to a FLY_ORG repo variable if the
auto-detect picks the wrong org or returns nothing. Handles both
array and object shapes of `fly orgs list -j` output to survive
flyctl version differences.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 16, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cotrackpro-talk Ready Ready Preview, Comment May 16, 2026 4:37pm

Request Review

@dougdevitre dougdevitre merged commit b70262d into main May 16, 2026
3 checks passed
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