mirror of
https://github.com/actions/setup-go.git
synced 2025-12-20 22:47:06 +00:00
add .tool-versions file support
This commit is contained in:
parent
20d79c58dd
commit
4faced9210
7 changed files with 62 additions and 14 deletions
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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue