Skip to content

Commit 47d08ea

Browse files
committed
fix(ci): preserve version replacements in update-deps workflow
Signed-off-by: CrazyMax <[email protected]>
1 parent b35c65c commit 47d08ea

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

.github/workflows/update-deps.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,13 @@ jobs:
297297
if (match[2] === target.value) {
298298
continue;
299299
}
300-
fs.writeFileSync(absolutePath, content.replace(target.pattern, `$1${target.value}$3`), 'utf8');
300+
const updatedContent = content.replace(target.pattern, (...args) => {
301+
const groups = args.slice(1, -2);
302+
const prefix = groups[0];
303+
const suffix = groups[2] || '';
304+
return `${prefix}${target.value}${suffix}`;
305+
});
306+
fs.writeFileSync(absolutePath, updatedContent, 'utf8');
301307
changedFiles.push(target.path);
302308
}
303309

0 commit comments

Comments
 (0)