-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SSH key not available in container actions #297
Comments
@TingluoHuang do you see any reason why RUNNER_TEMP shouldn't be mounted into a container action? I think that's the correct solution to fix this bug. Thoughts? |
I created a minimal example to reproduce the problem and for me to understand it better: https://github.com/frigus02/test-github-container-action-ssh-key. The latest build failed with the above error message. The problem is not the I realize now that this might be quite a rare issue. It requires you to use an SSH key, a container action with the necessary tools installed (git, ssh) and then access a git remote in the action. I should probably re-frame this issue as a feature request. It would be amazing if SSH keys would "just work" in container actions 🙂. |
@ericsciple Is there any chance of this being fixed? I ran into this recently while trying to leverage an action that utilizes a container, leading to much head scratching. As @frigus02 notes, the SSH command var is properly updated but the contents of that directory are not mounted in containers. Example code that will fail.
The upstream for this can be found at https://github.com/terraform-docs/gh-actions/blob/main/action.yml As far as I can tell, there is no way for me to mount the directory in question into a Docker container via an action.yml. I don't see how this is resolvable for end users without Github's intervention. |
An SSH key specified with
ssh-key
does not seem to be available in container actions (actions running Docker containers).Steps to reproduce
Setup a workflow like this:
You will get an error like this:
Error analysis
I assume that the actual action
stefanprodan/kube-tools@v1
doesn't matter. The reason seems to be that it runs in a Docker container. The command that the action runs is (line breaks added for readability):The checkout action logged earlier in the build:
I also logged the
$RUNNER_TEMP
variable and found that it points to/home/runner/work/_temp
. This directoy is not mounted in the Docker container, which makes me think that all container actions will have this problem.Side note: authenticating with a personal access token and the
token
option works fine, also later on in container actions.The text was updated successfully, but these errors were encountered: