Skip to content

Fly deploy: replace grep app-existence check with jq#41

Merged
dougdevitre merged 1 commit into
mainfrom
claude/fly-app-exists-jq
May 16, 2026
Merged

Fly deploy: replace grep app-existence check with jq#41
dougdevitre merged 1 commit into
mainfrom
claude/fly-app-exists-jq

Conversation

@dougdevitre
Copy link
Copy Markdown
Owner

Why

Last workflow run failed with:

auto-detected Fly org slug: cotrackpro
Error: Validation failed: Name has already been taken
creating app cotrackpro-talk in org cotrackpro

The app cotrackpro-talk was created in an earlier run, but the existence check missed it because fly apps list -j formats its JSON with whitespace between key/colon/value ("Name": "cotrackpro-talk"), and our grep pattern looked for the no-space form ("Name":"cotrackpro-talk"). The step then attempted to create the app and Fly correctly rejected it.

Fix

Use jq to parse the JSON and check for the app name. Handles both the array-of-apps shape and the object-keyed-by-app shape so we survive flyctl version differences.

Test plan


Generated by Claude Code

The grep-against-JSON existence check missed an existing app because
fly's JSON output has whitespace between key/colon/value ("Name":
"cotrackpro-talk") and the grep pattern looked for the no-space
form. The step then tried to create the app and Fly correctly
rejected with "Name has already been taken."

Switch to a jq predicate that parses the JSON and tolerates both
the array-of-apps and object-keyed-by-app shapes.
@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:59pm

Request Review

@dougdevitre dougdevitre merged commit df85e82 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