From 4dfae5ab3d543362e9c514b15fb3bedd632edb70 Mon Sep 17 00:00:00 2001 From: Shakar Bakr <5h4k4r.b4kr@gmail.com> Date: Sun, 1 Oct 2023 15:45:45 +0300 Subject: [PATCH] Update index.js Signed-off-by: Shakar Bakr <5h4k4r.b4kr@gmail.com> --- index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index afb74bc..285bccc 100644 --- a/index.js +++ b/index.js @@ -14,7 +14,7 @@ async function run() { const labelInput = core.getInput('label'); const filePath = getProjectInfoFilePath(filePathInput); - const file = require(filePath); + const file = await getFile(filePath); console.log(`Label: ${labelInput}`) @@ -203,3 +203,8 @@ function updateProjectVersion(filePath, newVersion) { else if (filePath.match(/package\.json/)) projectInfoFile.version = newVersion; } + +function getFile(filePath) { + const file = fs.readFileSync(filePath, 'utf8'); + return file; +}