export type Configs = { projectKey : string ; apiHost : string ; apiKey : string ; githubEventPath : string ; } ; returns throws export const getConfigs = ( ) : Configs => { return { projectKey : getConfig ( "project_key" , { required : true } ) , apiHost : getConfig ( "api_host" , { required : true } ) , apiKey : getConfig ( "api_key" , { required : true } ) , githubEventPath : getConfig ( "github_event_path" , { required : true } ) , } ; } ; type InputOptions = { required ? : boolean ; } ; param name param options returns const getConfig = ( name , options = { } ) : string => { const key = name . toUpperCase ( ) ; const input = process . env [ `INPUT_${ key }` ] ; const env = process . env [ key ] ; const val = input || env || "" ; if ( options . required && ! val ) { throw new Error ( `Input required and not supplied: ${ name }` ) ; } return val . trim ( ) ; } ;