From bf9b7d968686974603bee0e428705349689e5f53 Mon Sep 17 00:00:00 2001 From: Thorben Nissen Date: Fri, 10 Apr 2020 20:45:21 +0200 Subject: [PATCH] [DOC] Update readme with section about exported variables --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index ae8f836..56bd95f 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,20 @@ The `ssh-agent` will load all of the keys and try each one in order when establi 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 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. +## Exported variables +The action exports `SSH_AUTH_SOCK` and `SSH_AGENT_PID` through the Github Actions core module. +The `$SSH_AUTH_SOCK` is used by several applications like git or rsync to connect to the SSH authentication agent. +The `$SSH_AGENT_PID` can be used to kill the SSH agent, e.g. when using on a self-hosted runner: +```yaml +jobs: + job_1: + steps: + # ... + - name: Stop SSH agent + run: kill $SSH_AGENT_PID +``` +The variables are only available inside the current job. + ## Known issues and limitations ### Currently OS X and Linux only