-
While testing use of “set-env” on a self-hosted runner (2.164.0), I get “No such file or directory” error. Run echo ::set-env name=ENVIRONMENT::staging I’ve tried a few variations, but all the same result. I’m not able to get any of the commands mentioned on this page to work. Anyone else running into these problems? I see a couple of new versions of the runner, but not officially released yet. |
Beta Was this translation helpful? Give feedback.
Replies: 12 comments
-
Is your repository public? If so, can you point me to the workflow? If not, can you copy and paste your workflow file? |
Beta Was this translation helpful? Give feedback.
-
Not a public repo, but this is relevant and obfuscated workflow file. The clean workspace step works fine, but the “set-env” step fails every time with error, “[error]No such file or directory”
|
Beta Was this translation helpful? Give feedback.
-
I replied, but the response got marked as spam and removed? |
Beta Was this translation helpful? Give feedback.
-
Trying to upload snippet of workflow YAML one more time…
|
Beta Was this translation helpful? Give feedback.
-
This looks like an issue with your self-hosted runner - in particular, it looks like you can’t find the echo command. This seems like it may be a problem with your PATH? What if you try |
Beta Was this translation helpful? Give feedback.
-
I suspected something like that at first, but echo and /bin/echo appear to work. I’ve tested from an action and also when SSH session. Both are running as default ec2-user. |
Beta Was this translation helpful? Give feedback.
-
After turning on debugging for steps/runners (see enabling debug logging) I’m seeing more details. Doing more digging into those details. |
Beta Was this translation helpful? Give feedback.
-
From debug output, the first command with echo works just fine:
But the command with the set-env fails.
Is there any way to preserve the temp .sh files. Real curious to see inside these. They get cleaned up after build finishes. |
Beta Was this translation helpful? Give feedback.
-
I copied the files before they were cleaned up. Nothing more than the actual commands. |
Beta Was this translation helpful? Give feedback.
-
I’ve found the answer after more testing. Looks like something fishy with this step that was running before echo because when I remove that cleanup step, all the echo commands work fine. Going to call this resolved and dig into why cleanup is messing things up. Bizarre.
|
Beta Was this translation helpful? Give feedback.
-
After more testing, here are my findings.
|
Beta Was this translation helpful? Give feedback.
-
thanks rboekweg for the solution that it is very strange that we need checkout code first (add actions/checkout@v2) to make setup env work… |
Beta Was this translation helpful? Give feedback.
I’ve found the answer after more testing. Looks like something fishy with this step that was running before echo because when I remove that cleanup step, all the echo commands work fine. Going to call this resolved and dig into why cleanup is messing things up. Bizarre.