Skip to content

Commit 32c40ed

Browse files
committed
fix: regex on base builder workflow code
1 parent eebc3a0 commit 32c40ed

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/builders/src/base-builder.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -562,10 +562,11 @@ export abstract class BaseBuilder {
562562

563563
// Escape for embedding in a template literal string.
564564
// Order matters: backslashes first, then backticks, then dollar signs.
565+
// Using function replacements to avoid special $ patterns in replacement strings.
565566
const escapedWorkflowCode = workflowBundleCode
566-
.replace(/\\/g, '\\\\')
567-
.replace(/`/g, '\\`')
568-
.replace(/\$/g, '\\$');
567+
.replace(/\\/g, () => '\\\\')
568+
.replace(/`/g, () => '\\`')
569+
.replace(/\$/g, () => '\\$');
569570

570571
const workflowFunctionCode = `// biome-ignore-all lint: generated file
571572
/* eslint-disable */

0 commit comments

Comments
 (0)