Skip to content

fix: default DAG_DEPLOY_ENABLED to false and quote in bash condition#141

Merged
neel-astro merged 1 commit intoastronomer:mainfrom
jlaneve:fix/unquoted-dag-deploy-enabled-bash-syntax
Mar 20, 2026
Merged

fix: default DAG_DEPLOY_ENABLED to false and quote in bash condition#141
neel-astro merged 1 commit intoastronomer:mainfrom
jlaneve:fix/unquoted-dag-deploy-enabled-bash-syntax

Conversation

@jlaneve
Copy link
Copy Markdown
Contributor

@jlaneve jlaneve commented Mar 19, 2026

Summary

Fixes #140 — bash syntax error (conditional binary operator expected) when a deployment does not have DAG deploy enabled.

Root cause

astro deployment inspect ... --key configuration.dag_deploy_enabled returns an empty string when DAG deploy is not configured. This empty string is written directly to GITHUB_OUTPUT and then used unquoted in the Get Deploy Type bash condition:

# Before — empty value → bash sees `||  == false` → syntax error
if [[ ... || ${{ steps.dag-deploy-enabled.outputs.DAG_DEPLOY_ENABLED }} == false || ... ]]; then

Fix

Two changes, both defensive layers:

  1. Default to false at output time — use ${DAG_DEPLOY_ENABLED:-false} so the value written to GITHUB_OUTPUT is always "true" or "false", never empty.

  2. Quote the step output in the condition"${{ steps.dag-deploy-enabled.outputs.DAG_DEPLOY_ENABLED }}" == "false" so even an empty value produces valid bash ("" == "false").

Test plan

  • Trigger the action against a deployment with DAG deploy disabled — the Get Deploy Type step should no longer fail with conditional binary operator expected
  • Trigger against a deployment with DAG deploy enabled — existing behavior unchanged (DAG_DEPLOY_ENABLED=true, full image deploy skipped correctly)

🤖 Generated with Claude Code

When `astro deployment inspect` returns an empty string for deployments
without DAG deploy configured, the unquoted step output in the bash
condition on line ~454 produces invalid syntax (`||  == false`), causing
an exit code 2 / "conditional binary operator expected" error.

Two changes:
1. Use `${DAG_DEPLOY_ENABLED:-false}` when writing to GITHUB_OUTPUT so
   the value is always "true" or "false", never empty.
2. Quote `"${{ steps.dag-deploy-enabled.outputs.DAG_DEPLOY_ENABLED }}"` in
   the Get Deploy Type condition so an empty value (if it somehow slips
   through) doesn't break bash syntax.

Fixes astronomer#140
@jlaneve jlaneve requested a review from a team as a code owner March 19, 2026 20:11
@neel-astro neel-astro merged commit 8b78011 into astronomer:main Mar 20, 2026
1 check 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.

Unquoted ${{ steps.dag-deploy-enabled.outputs.DAG_DEPLOY_ENABLED }} causes bash syntax error when DAG deploy is not configured

2 participants