1
0
Fork 0
mirror of https://code.forgejo.org/actions/setup-go synced 2025-06-10 12:32:23 +02:00
This commit is contained in:
Sergey Dolin 2025-05-07 11:01:00 -07:00 committed by GitHub
commit cd0a960386
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 0 deletions

4
dist/setup/index.js vendored
View file

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

View file

@ -497,6 +497,9 @@ export function parseGoVersionFile(versionFilePath: string): string {
) { ) {
const match = contents.match(/^go (\d+(\.\d+)*)/m); const match = contents.match(/^go (\d+(\.\d+)*)/m);
return match ? match[1] : ''; return match ? match[1] : '';
} else if (path.basename(versionFilePath) === '.tool-versions') {
const match = contents.match(/^golang\s+(\d+(\.\d+)*)/m);
return match ? match[1] : '';
} }
return contents.trim(); return contents.trim();