1
0
Fork 0
mirror of https://code.forgejo.org/actions/setup-go synced 2025-06-08 03:28:21 +02:00

Merge pull request #283 from koba1t/add_support_gowork_for_go-version-file

add support go.work file for go-version-file
This commit is contained in:
Marko Zivic 2022-11-08 11:45:09 +01:00 committed by GitHub
commit e983b65a44
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 48 additions and 7 deletions

3
dist/setup/index.js vendored
View file

@ -63444,7 +63444,8 @@ function makeSemver(version) {
exports.makeSemver = makeSemver;
function parseGoVersionFile(versionFilePath) {
const contents = fs_1.default.readFileSync(versionFilePath).toString();
if (path.basename(versionFilePath) === 'go.mod') {
if (path.basename(versionFilePath) === 'go.mod' ||
path.basename(versionFilePath) === 'go.work') {
const match = contents.match(/^go (\d+(\.\d+)*)/m);
return match ? match[1] : '';
}