Closed justindoody closed 3 years ago
Correct, HOME
is modified here: https://github.com/nektos/act/blob/8de7b956b781bd4bb97bf6136d30e789501b17b4/pkg/runner/run_context.go#L578
@justindoody could you check if the issue is still present using -P ubuntu-latest=catthehacker/ubuntu:act-dev
?
I'm having this problem too. Would be great to hear about a solution.
Hi @irealva, proper solution will be removing below line and implementing #398 https://github.com/nektos/act/blob/8de7b956b781bd4bb97bf6136d30e789501b17b4/pkg/runner/run_context.go#L578
But workaround have been added in catthehacker/ubuntu:act-dev
image.
So you mean I should be able to run act -P ubuntu-18.04=catthehacker/ubuntu:act-dev
without the "SSH Agent" and "Setup SSH Known Hosts" steps? That doesn't seem to work for me either.
Thanks again!
@irealva ssh agent and known hosts are required since it's not viable to included known hosts in docker image because it would get outdated.
Got it, I misunderstood you. For others then I also solved the original poster's question with the act
standard image by using continue-on-error
:
name: Copy Known Hosts
continue-on-error: true
run: |
mkdir -p -m 0700 /root/.ssh
echo "Add domain to known hosts"
ssh-keyscan github.com > /root/.ssh/known_hosts
chmod 600 /root/.ssh/known_hosts
Act version
Expected behaviour
Typically and on github actions ssh will read files such as config, known_hosts, etc from
~/.ssh/
directory.Actual behaviour
When using act these files are only read from
/root/.ssh
. This likely has something to do withact
modifying the$HOME
directory in some order or timing differently than github actions. SSH does not necessarily read the current$HOME/.ssh
if home has been modified. See https://serverfault.com/a/951783 for additional context.Steps to reproduce
Expected to work and works on github actions but fails on act with host verification failed because ssh is not picking up the
known_hosts
file:Works on
act
but fails on github actions:This breaks most usage of ssh on
act
and in such a way that is quite painful and not obvious to debug as the overwhelming online references around ssh assume~/.ssh/
is going to get picked up.