Update index.js

Signed-off-by: Shakar Bakr <5h4k4r.b4kr@gmail.com>
This commit is contained in:
Shakar Bakr 2023-10-01 15:45:45 +03:00
parent 1e63237b51
commit 4dfae5ab3d
No known key found for this signature in database
GPG Key ID: DA55A26823AE3C28

View File

@ -14,7 +14,7 @@ async function run() {
const labelInput = core.getInput('label'); const labelInput = core.getInput('label');
const filePath = getProjectInfoFilePath(filePathInput); const filePath = getProjectInfoFilePath(filePathInput);
const file = require(filePath); const file = await getFile(filePath);
console.log(`Label: ${labelInput}`) console.log(`Label: ${labelInput}`)
@ -203,3 +203,8 @@ function updateProjectVersion(filePath, newVersion) {
else if (filePath.match(/package\.json/)) else if (filePath.match(/package\.json/))
projectInfoFile.version = newVersion; projectInfoFile.version = newVersion;
} }
function getFile(filePath) {
const file = fs.readFileSync(filePath, 'utf8');
return file;
}