You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Randomize SSH auth socket, kill agent to support non-ephemeral, self hosted runners (@thommyhh, #27)
Thanks to @thommyhh for this contribution!
Unless the `SSH_AUTH_SOCK` is configured explicitly, this change will make the SSH agent use a random file name for the socket. That way, multiple, concurrent SSH agents can be used on non-ephemeral, self-hosted runners.
A new post-action step will automatically clean up the running agent at the end of a job.
Be aware of the possible security implications: Two jobs running on the same runner might be able to access each other's socket and thus access repositories and/or hosts.
Copy file name to clipboardexpand all lines: README.md
+6-1
Original file line number
Diff line number
Diff line change
@@ -57,6 +57,11 @@ The `ssh-agent` will load all of the keys and try each one in order when establi
57
57
There's one **caveat**, though: SSH servers may abort the connection attempt after a number of mismatching keys have been presented. So if, for example, you have
58
58
six different keys loaded into the `ssh-agent`, but the server aborts after five unknown keys, the last key (which might be the right one) will never even be tried.
59
59
60
+
## Exported variables
61
+
The action exports `SSH_AUTH_SOCK` and `SSH_AGENT_PID` through the Github Actions core module.
62
+
The `$SSH_AUTH_SOCK` is used by several applications like git or rsync to connect to the SSH authentication agent.
63
+
The `$SSH_AGENT_PID` contains the process id of the agent. This is used to kill the agent in post job action.
64
+
60
65
## Known issues and limitations
61
66
62
67
### Currently OS X and Linux only
@@ -116,7 +121,7 @@ As a note to my future self, in order to work on this repo:
116
121
* Run `npm install` to fetch dependencies
117
122
* _hack hack hack_
118
123
* `node index.js`. Inputs are passed through `INPUT_` env vars with their names uppercased. Use `env "INPUT_SSH-PRIVATE-KEY=\`cat file\`" node index.js` for this action.
119
-
* Run `./node_modules/.bin/ncc build index.js` to update `dist/index.js`, which is the file actually run
124
+
* Run `npm run build` to update `dist/*`, which holds the files actually run
120
125
* Read https://help.github.com/en/articles/creating-a-javascript-action if unsure.
121
126
* Maybe update the README example when publishing a new version.
0 commit comments