Skip to content

fix: Codemagic bash compat — replace @Q syntax#5823

Merged
beastoin merged 1 commit intomainfrom
fix/codemagic-bash-compat
Mar 19, 2026
Merged

fix: Codemagic bash compat — replace @Q syntax#5823
beastoin merged 1 commit intomainfrom
fix/codemagic-bash-compat

Conversation

@beastoin
Copy link
Copy Markdown
Collaborator

Replace ${BETA_DMG_URL@Q} (Bash 4.4+ parameter transformation) with "${BETA_DMG_URL}" in the Codemagic post-build redirect page script. Codemagic's shell doesn't support @Q, causing "bad substitution" that kills the script before prod Cloud Run deploy runs.

v0.11.140 and v0.11.141 both failed on this. Once merged, the next tag will trigger a clean Codemagic build that completes prod deploy.

Closes #5822


by AI for @beastoin

Codemagic shell does not support ${VAR@Q} parameter transformation.
Use double-quoting for the JS string instead.

Closes #5822

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Mar 19, 2026

Greptile Summary

This PR fixes a one-line shell incompatibility in codemagic.yaml that was crashing the post-build redirect page generation step. The ${BETA_DMG_URL@Q} syntax (Bash 4.4+ parameter transformation for shell quoting) is not supported in Codemagic's shell, causing a bad substitution error before the production Cloud Run deploy could run. The fix replaces it with the standard "${BETA_DMG_URL}" expansion, which is consistent with how the same variable is already used in the two sibling HTML attributes on the lines above.

  • Root cause addressed: @Q is unavailable in the Bash version Codemagic uses; the script was dying before the prod deploy step.
  • Fix is minimal and targeted: only the one <script> line is changed; the meta-refresh and anchor href lines already used the plain "${BETA_DMG_URL}" form without issue.
  • No functional change: BETA_DMG_URL is constructed as https://github.com/$GITHUB_REPO/releases/download/$CM_TAG/omi.dmg — a well-formed URL with no characters that could break the double-quoted JS string literal.

Confidence Score: 5/5

  • This PR is safe to merge — it is a minimal, correct fix for a verified shell incompatibility with no functional side effects.
  • Single-line change replacing an unsupported Bash 4.4+ feature (@Q) with a standard double-quoted variable expansion. The replacement is semantically equivalent for a URL value, consistent with how the same variable is already used in adjacent lines, and directly addresses the confirmed CI failures on v0.11.140 and v0.11.141.
  • No files require special attention.

Important Files Changed

Filename Overview
codemagic.yaml Replaces the Bash 4.4+ @Q parameter transformation in the beta redirect HTML heredoc with a plain double-quoted variable expansion, restoring compatibility with Codemagic's shell environment.

Sequence Diagram

sequenceDiagram
    participant CM as Codemagic CI
    participant GH as GitHub Releases
    participant GCS as GCS Bucket
    participant Browser as End User Browser

    CM->>CM: Build & sign macOS DMG
    CM->>GH: Upload omi.dmg as release asset
    CM->>CM: Construct BETA_DMG_URL<br/>(github.com/…/omi.dmg)
    CM->>CM: Generate /tmp/macos-beta-index.html<br/>with "window.location.replace("${BETA_DMG_URL}")"
    CM->>GCS: Upload index.html → beta/index.html
    Browser->>GCS: GET beta/index.html
    GCS-->>Browser: HTML with JS redirect
    Browser->>GH: Redirect → download omi.dmg
Loading

Last reviewed commit: "fix: replace Bash 4...."

@beastoin beastoin merged commit c37214b into main Mar 19, 2026
2 checks passed
@beastoin beastoin deleted the fix/codemagic-bash-compat branch March 19, 2026 06:28
@beastoin
Copy link
Copy Markdown
Collaborator Author

lgtm

kodjima33 pushed a commit that referenced this pull request Mar 20, 2026
#5823)

Codemagic shell does not support ${VAR@Q} parameter transformation.
Use double-quoting for the JS string instead.

Closes #5822

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Glucksberg pushed a commit to Glucksberg/omi-local that referenced this pull request Apr 28, 2026
BasedHardware#5823)

Codemagic shell does not support ${VAR@Q} parameter transformation.
Use double-quoting for the JS string instead.

Closes BasedHardware#5822

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
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.

Codemagic: fix Bash 4.4+ @Q syntax in post-build redirect script

1 participant