Allow to unset env variables
See original GitHub issueecho 'SOME_VAR=some-value' >> $GITHUB_ENV
can be used to set an environment variable for subsequent steps, but there seems to be no documented way to unset it.
Note that echo 'SOME_VAR=' >> $GITHUB_ENV
will set it to the empty value, but that’s different from not having the variable set at all.
Rationale: In some workflows, it might be necessary to checkout and/or run untrusted code. At that point I’d like to clean up as much sensitive values as possible. Unsetting env vars (like SSH_AGENT_PID
or SSH_AUTH_SOCK
) is part of this.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:21
- Comments:11 (1 by maintainers)
Top Results From Across the Web
How to unset "ENV" in dockerfile?
For this case, you can use ENV VAR_NAME= at the point in your Dockerfile from which you want to unset the variable. Syntactic...
Read more >R: Set or Unset Environment Variables
Most platforms allow setting an environment variable to "" , but Windows does not and there Sys. setenv(FOO = "") unsets FOO.
Read more >How To Set and Unset Environment Variables on Linux
On Linux, there are two ways of unsetting environment variables : by using the unset command or by deleting variable entries into your...
Read more >Q100127: How to delete/unset environment variables
Windows 10/11 ... Type "env" in the Taskbar Search, and select Edit the system environment variables. ... Click the Environment Variables... button.
Read more >How do I set and then unset environment variables while ...
In Bourne-like or rc -like shells, to pass environment variables just to one invocation of one command, you'd do:
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yep, that’d also be my use case. The problem for me is that environment variables exported by
aws-actions/configure-aws-credentials
always have a higher precedence in the AWS CLI credentials chain than if I were to setAWS_PROFILE
.I’m facing the same issue - I need to cleanup AWS creds from the
aws-actions/configure-aws-credentials
step but don’t know how to do it properly.