[GH-ISSUE #2708] Support set but empty env variables #1222

Open
opened 2026-03-01 21:49:47 +03:00 by kerem · 1 comment
Owner

Originally created by @jklap on GitHub (Mar 24, 2025).
Original GitHub issue: https://github.com/nektos/act/issues/2708

Act version

act version: 0.2.75

Feature description

There are scenarios where we want to support sending empty vars and/or secrets into a workflow. But attempting to do this via any of the below scenarios doesn't work:

export MY_VAR=''
act --var MY_VAR
# act asks for input
export MY_SECRET=''
act --secret MY_SECRET
# act asks for input
act --var MY_VAR=''
# act asks for input
act --secret MY_SECRET=''
# act asks for input

We should support the ability to pass in a var or secret via the command line or a set-but-empty env var

Originally created by @jklap on GitHub (Mar 24, 2025). Original GitHub issue: https://github.com/nektos/act/issues/2708 ### Act version act version: 0.2.75 ### Feature description There are scenarios where we want to support sending empty vars and/or secrets into a workflow. But attempting to do this via any of the below scenarios doesn't work: ``` export MY_VAR='' act --var MY_VAR # act asks for input export MY_SECRET='' act --secret MY_SECRET # act asks for input act --var MY_VAR='' # act asks for input act --secret MY_SECRET='' # act asks for input ``` We should support the ability to pass in a var or secret via the command line or a set-but-empty env var
Author
Owner

@jklap commented on GitHub (Apr 8, 2025):

Thanks for the feedback but I didn't ask if there was a way to pass in an empty variable, I said those specifically listed scenarios don't work.

Testing for a variable, set yet empty, etc, is not relevant here -- the issue isn't within the workflow, it is to avoid act querying the user for a variable that we know is not going to be relevant (or we know is going to be empty)-- our use of act is highly scripted for testing purposes and asking for a variable prevents us automating this.

One specific example is the use of aws-actions/configure-aws-credentials -- a user using the AWS CLI to authenticate may not need to use role-to-assume but an IAM user used as a service account often times will. To support using the GHA via act and also running as a service account in GitHub we have to set a variable for role-to-assume in with: but for act it will always be empty. We have several other scenarios similar to this but are more unique/custom.

<!-- gh-comment-id:2786978792 --> @jklap commented on GitHub (Apr 8, 2025): Thanks for the feedback but I didn't ask if there was a way to pass in an empty variable, I said those specifically listed scenarios don't work. Testing for a variable, set yet empty, etc, is not relevant here -- the issue isn't within the workflow, it is to avoid act querying the user for a variable that we know is not going to be relevant (or we know is going to be empty)-- our use of act is highly scripted for testing purposes and asking for a variable prevents us automating this. One specific example is the use of aws-actions/configure-aws-credentials -- a user using the AWS CLI to authenticate may not need to use role-to-assume but an IAM user used as a service account often times will. To support using the GHA via act and also running as a service account in GitHub we have to set a variable for role-to-assume in with: but for act it will always be empty. We have several other scenarios similar to this but are more unique/custom.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/act#1222
No description provided.