From 29a37be0a3d3e8bf5bc1eb19cd0502922f5b312a Mon Sep 17 00:00:00 2001 From: priya-kinthali <147703874+priya-kinthali@users.noreply.github.com> Date: Fri, 6 Sep 2024 22:10:29 +0530 Subject: [PATCH] initial commit (#938) --- dist/setup/index.js | 4 +++- package-lock.json | 8 ++++---- src/utils.ts | 5 ++++- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/dist/setup/index.js b/dist/setup/index.js index 126f4a3..f1e3e29 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -92118,7 +92118,9 @@ function extractValue(obj, keys) { */ function getVersionInputFromTomlFile(versionFile) { core.debug(`Trying to resolve version form ${versionFile}`); - const pyprojectFile = fs_1.default.readFileSync(versionFile, 'utf8'); + let pyprojectFile = fs_1.default.readFileSync(versionFile, 'utf8'); + // Normalize the line endings in the pyprojectFile + pyprojectFile = pyprojectFile.replace(/\r\n/g, '\n'); const pyprojectConfig = toml.parse(pyprojectFile); let keys = []; if ('project' in pyprojectConfig) { diff --git a/package-lock.json b/package-lock.json index e5b2190..1417460 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4284,12 +4284,12 @@ } }, "node_modules/micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dev": true, "dependencies": { - "braces": "^3.0.2", + "braces": "^3.0.3", "picomatch": "^2.3.1" }, "engines": { diff --git a/src/utils.ts b/src/utils.ts index 3d1b3df..f3aa1ef 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -224,7 +224,10 @@ function extractValue(obj: any, keys: string[]): string | undefined { export function getVersionInputFromTomlFile(versionFile: string): string[] { core.debug(`Trying to resolve version form ${versionFile}`); - const pyprojectFile = fs.readFileSync(versionFile, 'utf8'); + let pyprojectFile = fs.readFileSync(versionFile, 'utf8'); + // Normalize the line endings in the pyprojectFile + pyprojectFile = pyprojectFile.replace(/\r\n/g, '\n'); + const pyprojectConfig = toml.parse(pyprojectFile); let keys = [];