mirror of
https://github.com/nektos/act.git
synced 2026-04-26 09:25:54 +03:00
[GH-ISSUE #1421] Environment variables not available in the context of the the workflow step definition #744
Labels
No labels
area/action
area/cli
area/docs
area/image
area/runner
area/workflow
backlog
confirmed/not-planned
kind/bug
kind/discussion
kind/external
kind/feature-request
kind/question
meta/duplicate
meta/invalid
meta/need-more-info
meta/resolved
meta/wontfix
meta/workaround
needs-work
pull-request
review/not-planned
size/M
size/XL
size/XXL
stale
stale-exempt
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/act#744
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @cyrus-mc on GitHub (Oct 31, 2022).
Original GitHub issue: https://github.com/nektos/act/issues/1421
Bug report info
Command used with act
Describe issue
I have the following sample workflow
For the last action
someInputis required. The previous step that dumps theenvshows thatfooBaris present. But the final step errors withsomeInputis a required input (I am doing input validation within that custom action).When running this in GitHub it works as expected, with the value of
env.fooBarbeing passed to the action.Link to GitHub repository
No response
Workflow content
Relevant log output
Additional information
No response
@cyrus-mc commented on GitHub (Nov 2, 2022):
Appears this applies for outputs as well. So I tried to work around this by doing something like the following:
But get same thing. The input is required and validation fails due to it being an empty string.
@cyrus-mc commented on GitHub (Nov 2, 2022):
Being looking into the code and I think I found the issue. Expression evaluation uses the runContext environment.
So as you can see it only includes the environment for the workflow, job and config. When modifying the code to loop over the rc.Env it only includes a few environment variables at the stage of evaluation.
@KnisterPeter commented on GitHub (Nov 2, 2022):
Please add your action.yml as well here.
I've did some changes lately. I'll have a look then.
@cyrus-mc commented on GitHub (Nov 2, 2022):
@KnisterPeter for the purposes of debugging I have a very simple
action.yml@a-b commented on GitHub (Nov 17, 2022):
@cyrus-mc consider rotating your aws secrets
@cyrus-mc commented on GitHub (Nov 17, 2022):
Those were temporary. Long since expired. Or should have.
@ChristopherHX commented on GitHub (Nov 23, 2022):
I'm looking into this issue right now.
I already fixed using the step env vars in the with block, see pr attached to this issue.
Since my big PR has been merged I try iron out critical bugs
@github-actions[bot] commented on GitHub (Dec 24, 2022):
Issue is stale and will be closed in 14 days unless there is new activity
@diepes commented on GitHub (Dec 30, 2022):
ran into this issue now. (2022-12-30)
local env vars ignored/missing for step: with uses: and with:
Fixed by trying latest act version.
brew unlink act
brew install act --HEAD