add .tool-versions file support

This commit is contained in:
priya-kinthali 2025-10-24 16:20:41 +05:30
parent 20d79c58dd
commit 4faced9210
7 changed files with 62 additions and 14 deletions

4
dist/setup/index.js vendored
View file

@ -94679,6 +94679,10 @@ function parseGoVersionFile(versionFilePath) {
const matchGo = contents.match(/^go (\d+(\.\d+)*)/m);
return matchGo ? matchGo[1] : '';
}
else if (path.basename(versionFilePath) === '.tool-versions') {
const match = contents.match(/^golang\s+([^\n#]+)/m);
return match ? match[1].trim() : '';
}
return contents.trim();
}
function resolveStableVersionDist(versionSpec, arch) {