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; +}