1
0
Fork 0
mirror of https://code.forgejo.org/actions/setup-python synced 2025-06-25 03:48:01 +02:00

optimize code

This commit is contained in:
mahabaleshwars 2025-03-06 16:36:53 +05:30
parent e34c938f7b
commit d5a4d05a4b
2 changed files with 4 additions and 10 deletions

View file

@ -290,7 +290,6 @@ export function getVersionInputFromToolVersions(versionFile: string): string[] {
try {
const fileContents = fs.readFileSync(versionFile, 'utf8');
const lines = fileContents.split('\n');
const versions: string[] = [];
for (const line of lines) {
// Skip commented lines
@ -303,11 +302,9 @@ export function getVersionInputFromToolVersions(versionFile: string): string[] {
}
}
if (versions.length === 0) {
core.warning(`No Python version found in ${versionFile}`);
}
core.warning(`No Python version found in ${versionFile}`);
return versions;
return [];
} catch (error) {
core.error(`Error reading ${versionFile}: ${(error as Error).message}`);
return [];