mirror of
https://github.com/actions/setup-go.git
synced 2025-06-28 07:53:43 +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:
commit
e983b65a44
7 changed files with 48 additions and 7 deletions
|
@ -316,7 +316,10 @@ export function makeSemver(version: string): string {
|
|||
export function parseGoVersionFile(versionFilePath: string): string {
|
||||
const contents = fs.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