Add support for .tool-versions file in setup-go, update workflow (#673)

* setup go in local

* add .tool-versions file support
This commit is contained in:
priya-kinthali
2025-10-28 20:56:52 +05:30
committed by GitHub
parent 7bc60db215
commit faf52423ec
8 changed files with 63 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) {