mirror of
https://code.forgejo.org/actions/setup-go
synced 2025-06-08 03:28:21 +02:00
add support gowork for go-version-file
This commit is contained in:
parent
c4a742cab1
commit
7678c83214
7 changed files with 48 additions and 7 deletions
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] : '';
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue