Skip to content

Commit

Permalink
Merge pull request #57 from buildkite/ps-215-treat-bare-dollar-sign-a…
Browse files Browse the repository at this point in the history
…s-literal

Bump github.com/buildkite/interpolate from 0.1.4 to 0.1.5
  • Loading branch information
jordandcarter authored Dec 16, 2024
2 parents e0a6437 + 5a82634 commit 4681733
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 3 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ retract (
)

require (
github.com/buildkite/interpolate v0.1.4
github.com/buildkite/interpolate v0.1.5
github.com/google/go-cmp v0.6.0
github.com/gowebpki/jcs v1.0.1
github.com/lestrrat-go/jwx/v2 v2.1.3
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
github.com/buildkite/interpolate v0.1.4 h1:qacB5WR+7+Ol1xiJ4xZajHh/CGDdhcMesXR+V3thZPA=
github.com/buildkite/interpolate v0.1.4/go.mod h1:dHnrwHew5O8VNOAgMDpwRlFnhL5VSN6M1bHVmRZ9Ccc=
github.com/buildkite/interpolate v0.1.5 h1:v2Ji3voik69UZlbfoqzx+qfcsOKLA61nHdU79VV+tPU=
github.com/buildkite/interpolate v0.1.5/go.mod h1:dHnrwHew5O8VNOAgMDpwRlFnhL5VSN6M1bHVmRZ9Ccc=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
Expand Down
25 changes: 25 additions & 0 deletions interpolate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,31 @@ func TestInterpolator(t *testing.T) {
},
},
},
{
name: "empty_variable_reference",
caseSensitive: true,
runtimeEnv: map[string]string{"FOO_BAR": "runtime_baz", "SECOND": "BAR"},
input: &Pipeline{
Env: ordered.MapFromItems(
ordered.TupleSS{Key: "BUILDKITE_MESSAGE", Value: "This $ is literal and should be ignored"},
),
Steps: Steps{
&CommandStep{
Command: "echo $BUILDKITE_MESSAGE",
},
},
},
expected: &Pipeline{
Env: ordered.MapFromItems(
ordered.TupleSS{Key: "BUILDKITE_MESSAGE", Value: "This $ is literal and should be ignored"},
),
Steps: Steps{
&CommandStep{
Command: "echo This $ is literal and should be ignored",
},
},
},
},
{
name: "runtime_env_precedence_order",
runtimeEnv: map[string]string{"FOO": "runtime_foo"},
Expand Down

0 comments on commit 4681733

Please sign in to comment.