question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow to unset env variables

See original GitHub issue

echo '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:open
  • Created 2 years ago
  • Reactions:21
  • Comments:11 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
michielvermeircommented, Apr 5, 2023

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.

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 set AWS_PROFILE.

1reaction
Constantin07commented, Jan 26, 2023

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found