This commit is contained in:
Shivam Mathur
2020-02-13 09:51:54 +05:30
commit 546224a999
26 changed files with 8591 additions and 0 deletions

22
src/utils.ts Normal file
View File

@@ -0,0 +1,22 @@
import * as fs from 'fs';
import * as core from '@actions/core';
/**
* Function to get inputs from both with and env annotations.
*
* @param name
* @param mandatory
*/
export async function getInput(
name: string,
mandatory: boolean
): Promise<string> {
const input = process.env[name];
switch (input) {
case '':
case undefined:
return core.getInput(name, {required: mandatory});
default:
return input;
}
}