Skip to content

fix: avoid unbound array expansion on macOS bash 3#14

Merged
edu-diaz merged 1 commit into
mainfrom
fix/macos-bash-empty-args
Apr 30, 2026
Merged

fix: avoid unbound array expansion on macOS bash 3#14
edu-diaz merged 1 commit into
mainfrom
fix/macos-bash-empty-args

Conversation

@edu-diaz
Copy link
Copy Markdown
Contributor

Summary

  • macOS GitHub runners ship bash 3.2, which treats "${ARGS[@]}" as an unbound-variable error when ARGS is empty under set -u.
  • This broke validate / diff / push / doc whenever no values / set overrides were provided — surfaced by the new macOS smoke tests in fix: add CI, dependabot, and auto-release workflows #13.
  • Fix: use the guarded ${ARGS[@]+"${ARGS[@]}"} expansion, which expands to nothing when the array is unset/empty rather than erroring.

Linux runners (bash 5) are unaffected either way; this just makes the action work on macOS.

Test plan

macOS runners ship bash 3.2, which errors on "${ARGS[@]}" when ARGS
is an empty array under set -u, breaking validate/diff/push/doc when
no values/set overrides are passed. Use the ${ARGS[@]+"${ARGS[@]}"}
guarded expansion so empty arrays produce zero arguments instead.
@edu-diaz edu-diaz merged commit c4400e9 into main Apr 30, 2026
@edu-diaz edu-diaz deleted the fix/macos-bash-empty-args branch April 30, 2026 09:43
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.

1 participant