Files
load-secrets-action/src/index.ts
2021-09-01 20:09:34 +02:00

25 lines
617 B
TypeScript

import * as core from '@actions/core';
import * as exec from '@actions/exec';
import path from 'path';
async function run(): Promise<void> {
try {
const parentDir = path.resolve(__dirname, '..');
// Get action inputs
const unsetPrevious = core.getInput('unset-previous');
const exportEnv = core.getInput('export-env');
// Execute bash script
await exec.exec(`sh -c "` +
`INPUT_UNSET_PREVIOUS=` + unsetPrevious + ` ` +
`INPUT_EXPORT_ENV=` + exportEnv + ` ` +
parentDir + `/entrypoint.sh"`);
} catch (error: any) {
core.setFailed(error.message);
}
}
run();