[GH-ISSUE #1098] Enhancement: Overwrite workflow env vars with passed in env vars #629

Closed
opened 2026-03-01 21:45:05 +03:00 by kerem · 1 comment
Owner

Originally created by @liamphmurphy on GitHub (Apr 2, 2022).
Original GitHub issue: https://github.com/nektos/act/issues/1098

Describe feature

Say we have a workflow that at either the job or steps layer has the following variable declaration:

foo: bar

At the time of writing, passing in an environment variable such as act -j job --env foo=another-value will not overwrite foo, and the value will be bar when the workflow runs in act.

The use case here is that I can overwrite the default behavior of the workflow in some way; such as where the workflow should find config files, for example. This could allow for testing without having to change the actual workflow first.

I came across this when I wanted to change the path to output some TLS certs that my app uses from what my workflow usually does.

Let me know if I missed something and it does actually work; I'm happy to go ahead and make the PR as well.

Originally created by @liamphmurphy on GitHub (Apr 2, 2022). Original GitHub issue: https://github.com/nektos/act/issues/1098 ## Describe feature Say we have a workflow that at either the job or steps layer has the following variable declaration: ``` foo: bar ``` At the time of writing, passing in an environment variable such as `act -j job --env foo=another-value` will not overwrite `foo`, and the value will be `bar` when the workflow runs in `act`. The use case here is that I can overwrite the default behavior of the workflow in some way; such as where the workflow should find config files, for example. This could allow for testing without having to change the actual workflow first. I came across this when I wanted to change the path to output some TLS certs that my app uses from what my workflow usually does. Let me know if I missed something and it does actually work; I'm happy to go ahead and make the PR as well.
kerem 2026-03-01 21:45:05 +03:00
Author
Owner

@liamphmurphy commented on GitHub (Apr 4, 2022):

Closing since #1100 was merged in

<!-- gh-comment-id:1087830139 --> @liamphmurphy commented on GitHub (Apr 4, 2022): Closing since #1100 was merged in
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#629
No description provided.