Skip to content

Commit a6faea6

Browse files
committed
add default swift version
1 parent db3967c commit a6faea6

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

index.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ const tc = require("@actions/tool-cache");
44
const os = require("os");
55
const path = require("path");
66

7+
const defaultSwiftVersion = "wasm-5.7.1-RELEASE";
8+
79
async function run(version) {
810
validateVersion(version);
911
const platform = resolveHostPlatform();
@@ -57,17 +59,16 @@ function resolveVersionInput() {
5759
return versionFile;
5860
}
5961
}
60-
const message = "No Swift version specified. Please specify a version using the 'swift-version' input or a .swift-version file.";
61-
core.error(message);
62-
throw new Error(message);
62+
core.debug(`Using version from default: ${defaultSwiftVersion}`);
63+
return defaultSwiftVersion;
6364
}
6465

6566
function validateVersion(version) {
6667
if (version === "") {
6768
throw new Error("Empty version specified.");
6869
}
6970
if (!version.startsWith("wasm-")) {
70-
throw new Error(`Invalid version specified: ${version}. Version must start with 'wasm-'. For example: 'wasm-5.7.1-RELEASE'`);
71+
throw new Error(`Invalid version specified: ${version}. Version must start with 'wasm-'. For example: '${defaultSwiftVersion}'`);
7172
}
7273
}
7374

0 commit comments

Comments
 (0)