mirror of
https://github.com/actions/setup-go.git
synced 2025-05-04 14:14:34 +00: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:
3
dist/setup/index.js
vendored
3
dist/setup/index.js
vendored
@ -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] : '';
|
||||
}
|
||||
|
Reference in New Issue
Block a user