Skip to content
Snippets Groups Projects
Unverified Commit 31ce4729 authored by Rhys Arkins's avatar Rhys Arkins Committed by GitHub
Browse files

fix(gomod): use go get to generate pseudo versions for digest updates (#4386)

Instead of generating the pseudo version ourselves, replace the existing pseudo version with a digest only and let “go get” massage it into a valid pseudo version.
parent d0a32a53
No related branches found
No related tags found
No related merge requests found
import { DateTime } from 'luxon';
import { logger } from '../../logger';
import { Upgrade } from '../common';
......@@ -57,9 +56,10 @@ export function updateDependency(
{ depName, lineToChange, newDigestRightSized },
'gomod: need to update digest'
);
const currentDateTime = DateTime.local().toFormat('yyyyMMddHHmmss');
const newValue = `v0.0.0-${currentDateTime}-${newDigestRightSized}`;
newLine = lineToChange.replace(updateLineExp, `$1$2${newValue}`);
newLine = lineToChange.replace(
updateLineExp,
`$1$2${newDigestRightSized}`
);
} else {
newLine = lineToChange.replace(updateLineExp, `$1$2${upgrade.newValue}`);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment