ci(levitate): migrate scripts to es modules

This commit is contained in:
Jack Westbrook
2025-03-03 09:43:26 +01:00
parent c6cc559b5a
commit 7c10280b7f
2 changed files with 19 additions and 17 deletions
@@ -1,18 +1,20 @@
module.exports = async ({ core, filePath }) => {
try {
const fs = require('fs').promises;
const content = await fs.readFile(filePath)
const result = JSON.parse(content);
core.startGroup('Parsing json file...');
const jsonToJobOutput = async ({ core, filePath }) => {
try {
const fs = await import('fs/promises');
const content = await fs.readFile(filePath)
const result = JSON.parse(content);
for (const property in result) {
core.info(`${property} <- ${result[property]}`);
core.setOutput(property, result[property]);
}
core.startGroup('Parsing json file...');
core.endGroup();
} catch (error) {
core.setFailed(error.message);
}
}
for (const property in result) {
core.info(`${property} <- ${result[property]}`);
core.setOutput(property, result[property]);
}
core.endGroup();
} catch (error) {
core.setFailed(error.message);
}
}
export default jsonToJobOutput