toolkit icon indicating copy to clipboard operation
toolkit copied to clipboard

Core: Ability to get all environment variables

Open tzzs opened this issue 4 years ago • 2 comments

Describe the enhancement

Because I can not get $HOME from toolkit/exec, but I have many places where I use it. So I want to have a way to get all environment variables in custom actions.

Code Snippet

Add a new function in core.ts.

export function getEnv(name: string): string {
  const val: string = process.env[name.toUpperCase()] || ''
  return val.trim()
}

And I could use it in my custom actions like this.

let HOME_DIR = core.getEnv('HOME')

tzzs avatar Nov 24 '21 16:11 tzzs

Any update on this topic?

Sawthis avatar Apr 04 '24 08:04 Sawthis

Any update on this topic?

Nothing : (

tzzs avatar Apr 08 '24 13:04 tzzs