mirror of
https://github.com/actions/setup-go.git
synced 2025-10-30 15:00:33 +00:00
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:
4
dist/setup/index.js
vendored
4
dist/setup/index.js
vendored
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user