Initial commit
Some checks failed
Some checks failed
This commit is contained in:
8
src/index.ts
Normal file
8
src/index.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* The entrypoint for the action. This file simply imports and runs the action's
|
||||
* main logic.
|
||||
*/
|
||||
import { run } from './main.js';
|
||||
|
||||
/* istanbul ignore next */
|
||||
run();
|
||||
19
src/main.ts
Normal file
19
src/main.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import * as core from '@actions/core';
|
||||
import * as fs from 'fs';
|
||||
|
||||
/**
|
||||
* The main function for the action.
|
||||
*
|
||||
* @returns Resolves when the action is complete.
|
||||
*/
|
||||
export async function run(): Promise<void> {
|
||||
try {
|
||||
const bakefile: string = core.getInput('bakefile', { required: true });
|
||||
const metadata = JSON.parse(fs.readFileSync(bakefile, 'utf-8'));
|
||||
core.info(`Metadata: ${JSON.stringify(metadata)}`);
|
||||
// core.info(`Bakefile:\t${bakefile}`);
|
||||
} catch (error) {
|
||||
// Fail the workflow run if an error occurs
|
||||
if (error instanceof Error) core.setFailed(error.message);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user