mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-13 07:26:26 +00:00
fix(gomod): no infinite major updates
This commit is contained in:
parent
e790af89d1
commit
924efa837f
1 changed files with 4 additions and 1 deletions
|
@ -41,7 +41,10 @@ function updateDependency(currentFileContent, upgrade) {
|
||||||
if (upgrade.depName.startsWith('gopkg.in/')) {
|
if (upgrade.depName.startsWith('gopkg.in/')) {
|
||||||
const oldV = upgrade.depName.split('.').pop();
|
const oldV = upgrade.depName.split('.').pop();
|
||||||
newLine = newLine.replace(`.${oldV}`, `.v${upgrade.newMajor}`);
|
newLine = newLine.replace(`.${oldV}`, `.v${upgrade.newMajor}`);
|
||||||
} else if (upgrade.newMajor > 1) {
|
} else if (
|
||||||
|
upgrade.newMajor > 1 &&
|
||||||
|
!newLine.includes(`/v${upgrade.newMajor}`)
|
||||||
|
) {
|
||||||
if (upgrade.currentValue.match(/^v(0|1)\./)) {
|
if (upgrade.currentValue.match(/^v(0|1)\./)) {
|
||||||
// Add version
|
// Add version
|
||||||
newLine = newLine.replace(requireLine, `$1/v${upgrade.newMajor}$2$3`);
|
newLine = newLine.replace(requireLine, `$1/v${upgrade.newMajor}$2$3`);
|
||||||
|
|
Loading…
Reference in a new issue