Skip to content

Commit e2e67fe

Browse files
authored
Merge pull request #1081 from docker/fix-update-deps-2
fix(ci): preserve version replacements in update-deps workflow
2 parents b35c65c + 47d08ea commit e2e67fe

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)