Merge pull request #1081 from docker/fix-update-deps-2
fix(ci): preserve version replacements in update-deps workflow
This commit is contained in:
8
.github/workflows/update-deps.yml
vendored
8
.github/workflows/update-deps.yml
vendored
@@ -297,7 +297,13 @@ jobs:
|
|||||||
if (match[2] === target.value) {
|
if (match[2] === target.value) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
fs.writeFileSync(absolutePath, content.replace(target.pattern, `$1${target.value}$3`), 'utf8');
|
const updatedContent = content.replace(target.pattern, (...args) => {
|
||||||
|
const groups = args.slice(1, -2);
|
||||||
|
const prefix = groups[0];
|
||||||
|
const suffix = groups[2] || '';
|
||||||
|
return `${prefix}${target.value}${suffix}`;
|
||||||
|
});
|
||||||
|
fs.writeFileSync(absolutePath, updatedContent, 'utf8');
|
||||||
changedFiles.push(target.path);
|
changedFiles.push(target.path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user