Switch to node action

This is done to be able to pass loaded secrets as output. This is not available with a composite action, unless we hard-code the action's outputs, which is not a desired outcome.
This commit is contained in:
Eddy Filip
2021-09-01 18:20:57 +02:00
parent e8da10d005
commit ac12d2e3c4
8 changed files with 2415 additions and 9 deletions

24
src/index.ts Normal file
View File

@@ -0,0 +1,24 @@
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();