Check for deno-version-file before defaulting to deno-version

Signed-off-by: Jesse Dijkstra <mail@jessedijkstra.nl>
This commit is contained in:
Jesse Dijkstra 2024-07-02 15:10:38 +02:00
parent 188e7e8452
commit 4ad93eed32
2 changed files with 3 additions and 2 deletions

View File

@ -7,7 +7,6 @@ branding:
inputs: inputs:
deno-version: deno-version:
description: The Deno version to install. Can be a semver version of a stable release, "canary" for the latest canary, or the Git hash of a specific canary release. description: The Deno version to install. Can be a semver version of a stable release, "canary" for the latest canary, or the Git hash of a specific canary release.
default: "1.x"
deno-version-file: deno-version-file:
description: File containing the Deno version to install such as .dvmrc or .tool-versions. Overridden by deno-version. description: File containing the Deno version to install such as .dvmrc or .tool-versions. Overridden by deno-version.
outputs: outputs:

View File

@ -21,7 +21,9 @@ async function main() {
try { try {
const denoVersionFile = core.getInput("deno-version-file"); const denoVersionFile = core.getInput("deno-version-file");
const range = parseVersionRange( const range = parseVersionRange(
core.getInput("deno-version") || getDenoVersionFromFile(denoVersionFile) denoVersionFile
? getDenoVersionFromFile(denoVersionFile)
: core.getInput("deno-version")
); );
if (range === null) { if (range === null) {