Skip to content

fix: Use single quotes for build_args to prevent shell variable expansion#86

Merged
GordonBeeming merged 1 commit intomainfrom
gb/fix-build-args-expansion
Mar 25, 2026
Merged

fix: Use single quotes for build_args to prevent shell variable expansion#86
GordonBeeming merged 1 commit intomainfrom
gb/fix-build-args-expansion

Conversation

@GordonBeeming
Copy link
Owner

Summary

  • The matrix build_args values use $PLACEHOLDER tokens (e.g. $COPILOT_VERSION) intended for bash string substitution in the "Prepare build args" step
  • Using double quotes on ARGS="${{ matrix.build_args }}" caused bash to expand these as shell variables (unset = empty) before the substitution could replace them
  • This meant all Docker build args were always empty, with images silently falling back to Dockerfile ARG defaults
  • The csharp-ls install broke because dotnet tool install --version "" is an error (unlike npm/go which tolerate empty versions)
  • Fix: switch to single quotes ARGS='${{ matrix.build_args }}' to preserve the $ placeholders for the substitution step

Test plan

  • prepare-versions resolves all versions correctly
  • Docker build commands show non-empty --build-arg values
  • All image builds pass, including dotnet and dotnet-10

Generated with Claude Code and GitButler

…sion

The matrix build_args values contain $PLACEHOLDER tokens (e.g.
$COPILOT_VERSION) that are meant to be replaced by bash string
substitution in the "Prepare build args" step. However, using double
quotes on the ARGS assignment caused bash to expand these as shell
variables (which are unset, so they become empty strings) before the
substitution step could replace them. This resulted in all Docker
build args being empty, with images falling back to Dockerfile ARG
defaults.

Switching to single quotes preserves the $ placeholders so the
substitution step works correctly.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: GitButler <gitbutler@gitbutler.com>
@GordonBeeming GordonBeeming marked this pull request as ready for review March 25, 2026 00:37
Copilot AI review requested due to automatic review settings March 25, 2026 00:37
@GordonBeeming GordonBeeming merged commit eb4eed0 into main Mar 25, 2026
30 checks passed
@GordonBeeming GordonBeeming deleted the gb/fix-build-args-expansion branch March 25, 2026 00:38
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes the build-images job in the publish workflow so $PLACEHOLDER tokens in matrix.build_args aren’t expanded by bash before the workflow’s string-substitution logic runs, ensuring Docker builds receive the resolved dependency versions as intended.

Changes:

  • Switch ARGS="${{ matrix.build_args }}" to ARGS='${{ matrix.build_args }}' to preserve $... placeholders for subsequent substitution.
  • Restores correct non-empty Docker build-args values (notably preventing empty dotnet tool install --version "" cases).

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