Fix function export

This commit is contained in:
Rodel Calasagsag 2023-08-16 08:14:22 +08:00
parent bbfa6c0644
commit d351853bc1
2 changed files with 97 additions and 88 deletions

View File

@ -1,5 +1,10 @@
const { API_RESULT, E2E_RESULT, k6_RESULT, PLUGINS_BLOCKS_PATH } = process.env;
const { selectEmoji, readContextBlocksFromJsonFiles } = require( './utils' );
module.exports = ( { core } ) => {
const { API_RESULT, E2E_RESULT, k6_RESULT, PLUGINS_BLOCKS_PATH } =
process.env;
const {
selectEmoji,
readContextBlocksFromJsonFiles,
} = require( './utils' );
const block_header = {
type: 'header',
@ -44,7 +49,8 @@ const block_nightlySite = {
],
};
const blocks_plugins = readContextBlocksFromJsonFiles( PLUGINS_BLOCKS_PATH );
const blocks_plugins =
readContextBlocksFromJsonFiles( PLUGINS_BLOCKS_PATH );
const payload = {
blocks: [ block_header, block_nightlySite, ...blocks_plugins ],
@ -53,3 +59,4 @@ const payload = {
const payload_stringified = JSON.stringify( payload );
core.setOuput( 'payload', payload_stringified );
};

View File

@ -1,3 +1,4 @@
module.exports = ( { core } ) => {
const { UPLOAD_RESULT, E2E_RESULT, PLUGIN_NAME, PLUGIN_SLUG } = process.env;
const { selectEmoji } = require( './utils' );
const fs = require( 'fs' );
@ -36,3 +37,4 @@ const path = `/tmp/${ PLUGIN_SLUG }.json`;
fs.writeFileSync( path, block_stringified );
core.setOutput( 'path', path );
};