ci(levitate): migrate scripts to es modules
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user