diff --git a/src/__tests__/command.spec.ts b/src/__tests__/command.spec.ts index a9feb29..fa9f8da 100644 --- a/src/__tests__/command.spec.ts +++ b/src/__tests__/command.spec.ts @@ -383,7 +383,16 @@ describe('buildkite-graph', () => { .withParameterOverride('priority', 'MY_PRIORITY') .toJson(), ).resolves.toEqual( - expect.objectContaining({ priority: '${MY_PRIORITY}' }), + expect.objectContaining({ priority: '$MY_PRIORITY' }), + ); + }); + it('supports double escape', async () => { + await expect( + new CommandStep('noop') + .withParameterOverride('priority', '$MY_PRIORITY') + .toJson(), + ).resolves.toEqual( + expect.objectContaining({ priority: '$$MY_PRIORITY' }), ); }); }); diff --git a/src/steps/command.ts b/src/steps/command.ts index c80c851..98b9365 100644 --- a/src/steps/command.ts +++ b/src/steps/command.ts @@ -285,7 +285,7 @@ export class CommandStep extends LabeledStep { private valueWithOverride(value: T, key: CommandProperty): string | T { if (this.overrides.has(key)) { - return `$\{${this.overrides.get(key) as string}}`; + return ('$' + this.overrides.get(key)) as string; } return value; }