From 3467d92d48812f2876be76290f77c3d8a728212a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferran=20Par=C3=A9s?= Date: Fri, 6 Oct 2023 12:34:33 +0200 Subject: [PATCH] Trim python version to get rid of '\n' (#628) --- dist/setup/index.js | 2 +- src/utils.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/setup/index.js b/dist/setup/index.js index ef8220c..5876e78 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -70160,7 +70160,7 @@ exports.getVersionInputFromTomlFile = getVersionInputFromTomlFile; */ function getVersionInputFromPlainFile(versionFile) { core.debug(`Trying to resolve version form ${versionFile}`); - const version = fs_1.default.readFileSync(versionFile, 'utf8'); + const version = fs_1.default.readFileSync(versionFile, 'utf8').trim(); core.info(`Resolved ${versionFile} as ${version}`); return [version]; } diff --git a/src/utils.ts b/src/utils.ts index 5f000c1..eba5b75 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -251,7 +251,7 @@ export function getVersionInputFromTomlFile(versionFile: string): string[] { */ export function getVersionInputFromPlainFile(versionFile: string): string[] { core.debug(`Trying to resolve version form ${versionFile}`); - const version = fs.readFileSync(versionFile, 'utf8'); + const version = fs.readFileSync(versionFile, 'utf8').trim(); core.info(`Resolved ${versionFile} as ${version}`); return [version]; }