mirror of
https://code.forgejo.org/actions/setup-go.git
synced 2026-08-27 20:44:57 -04:00
Merge 1adbf3753d into fba3fb4ead
This commit is contained in:
commit
a6bde20ba5
4 changed files with 242 additions and 20 deletions
5
dist/setup/index.js
vendored
5
dist/setup/index.js
vendored
|
|
@ -43813,7 +43813,8 @@ async function findMatch(versionSpec, arch = external_os_default().arch(), dlUrl
|
|||
const candidate = candidates[i];
|
||||
const version = makeSemver(candidate.version);
|
||||
core_debug(`check ${version} satisfies ${versionSpec}`);
|
||||
if (node_modules_semver.satisfies(version, versionSpec)) {
|
||||
if (candidate.version.replace(/^go/, '') === versionSpec ||
|
||||
node_modules_semver.satisfies(version, versionSpec)) {
|
||||
goFile = candidate.files.find(file => {
|
||||
core_debug(`${file.arch}===${archFilter} && ${file.os}===${platFilter}`);
|
||||
return file.arch === archFilter && file.os === platFilter;
|
||||
|
|
@ -43869,7 +43870,7 @@ function parseGoVersionFile(versionFilePath) {
|
|||
}
|
||||
}
|
||||
// go directive: https://go.dev/ref/mod#go-mod-file-go
|
||||
const matchGo = contents.match(/^go (\d+(\.\d+)*)/m);
|
||||
const matchGo = contents.match(/^go (\d+(\.\d+)*(?:\.\d+|(beta|rc)\d+)?)/m);
|
||||
return matchGo ? matchGo[1] : '';
|
||||
}
|
||||
else if (external_path_.basename(versionFilePath) === '.tool-versions') {
|
||||
|
|
|
|||
Loading…
Reference in a new issue