diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b9c151a..eaf9acb7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,10 @@ and this project adheres to - Add support for arm64. +### Changed + +- Fail on missing required input instead of warning. + ## [2.0.5] ### Changed diff --git a/dist/index.js b/dist/index.js index 6e122425..6261302f 100644 --- a/dist/index.js +++ b/dist/index.js @@ -95134,32 +95134,39 @@ const CYGWIN_ROOT = external_path_.join("D:", "cygwin"); const CYGWIN_ROOT_BIN = external_path_.join(CYGWIN_ROOT, "bin"); const CYGWIN_ROOT_WRAPPERBIN = external_path_.join(CYGWIN_ROOT, "wrapperbin"); const CACHE_PREFIX = lib_core.getInput("cache-prefix", { + required: false, trimWhitespace: true, }); const constants_GITHUB_TOKEN = lib_core.getInput("github-token", { + required: false, trimWhitespace: true, }); const DUNE_CACHE = lib_core.getBooleanInput("dune-cache", { + required: false, trimWhitespace: true, }); const OCAML_COMPILER = lib_core.getInput("ocaml-compiler", { + required: true, trimWhitespace: true, }); const OPAM_DEPEXT = lib_core.getBooleanInput("opam-depext", { + required: false, trimWhitespace: true, }); -const OPAM_DEPEXT_FLAGS = lib_core.getInput("opam-depext-flags", { trimWhitespace: true }) +const OPAM_DEPEXT_FLAGS = lib_core.getInput("opam-depext-flags", { required: false, trimWhitespace: true }) .split(",") .map((f) => f.trim()) .filter((f) => f.length > 0); -const OPAM_DISABLE_SANDBOXING = lib_core.getBooleanInput("opam-disable-sandboxing", { trimWhitespace: true }); +const OPAM_DISABLE_SANDBOXING = lib_core.getBooleanInput("opam-disable-sandboxing", { required: false, trimWhitespace: true }); const OPAM_LOCAL_PACKAGES = lib_core.getInput("opam-local-packages", { + required: false, trimWhitespace: true, }); const OPAM_PIN = lib_core.getBooleanInput("opam-pin", { + required: false, trimWhitespace: true, }); -const repositories_yaml = dist/* parse */.Qc(lib_core.getInput("opam-repositories", { trimWhitespace: true })); +const repositories_yaml = dist/* parse */.Qc(lib_core.getInput("opam-repositories", { required: false, trimWhitespace: true })); const platform = getPlatform(); const defaultRepository = platform !== "win32" /* Platform.Win32 */ ? "https://github.com/ocaml/opam-repository.git" diff --git a/dist/post/index.js b/dist/post/index.js index 42a548a2..8b6a4b98 100644 --- a/dist/post/index.js +++ b/dist/post/index.js @@ -91362,32 +91362,39 @@ const CYGWIN_ROOT = external_path_.join("D:", "cygwin"); const CYGWIN_ROOT_BIN = external_path_.join(CYGWIN_ROOT, "bin"); const CYGWIN_ROOT_WRAPPERBIN = external_path_.join(CYGWIN_ROOT, "wrapperbin"); const constants_CACHE_PREFIX = lib_core.getInput("cache-prefix", { + required: false, trimWhitespace: true, }); const constants_GITHUB_TOKEN = lib_core.getInput("github-token", { + required: false, trimWhitespace: true, }); const DUNE_CACHE = lib_core.getBooleanInput("dune-cache", { + required: false, trimWhitespace: true, }); const constants_OCAML_COMPILER = lib_core.getInput("ocaml-compiler", { + required: true, trimWhitespace: true, }); const OPAM_DEPEXT = lib_core.getBooleanInput("opam-depext", { + required: false, trimWhitespace: true, }); -const OPAM_DEPEXT_FLAGS = lib_core.getInput("opam-depext-flags", { trimWhitespace: true }) +const OPAM_DEPEXT_FLAGS = lib_core.getInput("opam-depext-flags", { required: false, trimWhitespace: true }) .split(",") .map((f) => f.trim()) .filter((f) => f.length > 0); -const OPAM_DISABLE_SANDBOXING = lib_core.getBooleanInput("opam-disable-sandboxing", { trimWhitespace: true }); +const OPAM_DISABLE_SANDBOXING = lib_core.getBooleanInput("opam-disable-sandboxing", { required: false, trimWhitespace: true }); const OPAM_LOCAL_PACKAGES = lib_core.getInput("opam-local-packages", { + required: false, trimWhitespace: true, }); const OPAM_PIN = lib_core.getBooleanInput("opam-pin", { + required: false, trimWhitespace: true, }); -const repositories_yaml = dist/* parse */.Qc(lib_core.getInput("opam-repositories", { trimWhitespace: true })); +const repositories_yaml = dist/* parse */.Qc(lib_core.getInput("opam-repositories", { required: false, trimWhitespace: true })); const platform = system_getPlatform(); const defaultRepository = platform !== "win32" /* Platform.Win32 */ ? "https://github.com/ocaml/opam-repository.git" diff --git a/src/setup-ocaml/constants.ts b/src/setup-ocaml/constants.ts index 358ea852..9c52691a 100644 --- a/src/setup-ocaml/constants.ts +++ b/src/setup-ocaml/constants.ts @@ -22,46 +22,53 @@ export const CYGWIN_ROOT_BIN = path.join(CYGWIN_ROOT, "bin"); export const CYGWIN_ROOT_WRAPPERBIN = path.join(CYGWIN_ROOT, "wrapperbin"); export const CACHE_PREFIX = core.getInput("cache-prefix", { + required: false, trimWhitespace: true, }); export const GITHUB_TOKEN = core.getInput("github-token", { + required: false, trimWhitespace: true, }); export const DUNE_CACHE = core.getBooleanInput("dune-cache", { + required: false, trimWhitespace: true, }); export const OCAML_COMPILER = core.getInput("ocaml-compiler", { + required: true, trimWhitespace: true, }); export const OPAM_DEPEXT = core.getBooleanInput("opam-depext", { + required: false, trimWhitespace: true, }); export const OPAM_DEPEXT_FLAGS = core - .getInput("opam-depext-flags", { trimWhitespace: true }) + .getInput("opam-depext-flags", { required: false, trimWhitespace: true }) .split(",") .map((f) => f.trim()) .filter((f) => f.length > 0); export const OPAM_DISABLE_SANDBOXING = core.getBooleanInput( "opam-disable-sandboxing", - { trimWhitespace: true } + { required: false, trimWhitespace: true } ); export const OPAM_LOCAL_PACKAGES = core.getInput("opam-local-packages", { + required: false, trimWhitespace: true, }); export const OPAM_PIN = core.getBooleanInput("opam-pin", { + required: false, trimWhitespace: true, }); const repositories_yaml = yaml.parse( - core.getInput("opam-repositories", { trimWhitespace: true }) + core.getInput("opam-repositories", { required: false, trimWhitespace: true }) ) as Record | null; const platform = getPlatform();