Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions src/setup-perl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,19 @@ async function resolveVersionInput(): Promise<string> {
return version;
}

const versionFilePath = path.join(process.env.GITHUB_WORKSPACE || "", versionFile || ".python-version");
version = await fs.readFile(versionFilePath, "utf8");
core.info(`Resolved ${versionFile} as ${version}`);
return version;
try {
const versionFilePath = path.join(process.env.GITHUB_WORKSPACE || "", versionFile || ".perl-version");
version = await fs.readFile(versionFilePath, "utf8");
core.info(`Resolved ${versionFile} as ${version}`);
return version;
} catch (err) {
if ((err as any)?.code !== "ENOENT" || versionFile) {
throw err;
}
}

// use the default version.
return "5";
}

run();