actions / actions/toolkit

Core: Ability to get all environment variables

Open
#944 2 comments 15 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
5.9k
Forks
1.8k
PR merge metrics
No merged PRs in 30d

Description

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')

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in core.ts, where the issue requests a new environment-variable helper for custom actions. Check how toolkit/exec and existing core utilities expose process values, then verify that the helper returns the requested environment variable in the expected form. Done means custom actions can retrieve values such as HOME through core.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.