actions / actions/toolkit

Support unsetting of environment variables in core

Open
#1,147 0 comments 2 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
Within pkg/core/src/core.ts, I would like the ability to unset environment variables. Today there is a exportVariable function, but I would like an additional unsetVariable function to be added. This would allow one to remove the variable from the running environment. One can simply blank the variable - but have the ability to completely remove it would be nice.

Code Snippet
JSON.parse(myEnvVariables).forEach((env: string) => { core.unsetVariable(env); });

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 pkg/core/src/core.ts and compare the requested unsetVariable function with the existing exportVariable function. Confirm how environment variables are currently changed, then implement removal of a variable from the running environment; done means callers can use the shown loop to completely unset each variable.

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
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.