diff --git a/README.md b/README.md index 7660375c..db6cdb07 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,26 @@ Interactive debugger for GitHub Actions +## Usage + +In the log for the action you will see: + +``` +Running tmate... + +To connect to this session copy-n-paste the following into a terminal: + +ssh redactedMxoJ0pXmjredacted@nyc1.tmate.io +``` + +Simply follow the instructions and copy the ssh command into your terminal to create an ssh connection the running instance. The session will close immedeatly after closing the ssh connection to the running instance. + +There is a global timeout after 15 minutes. This will close any open ssh sessions. To prevent the session from being terminated run: + +``` +touch /tmp/keepalive +``` + ## Acknowledgments * [tmate.io](https://tmate.io) diff --git a/script.sh b/script.sh index 037c02b2..5c308500 100755 --- a/script.sh +++ b/script.sh @@ -24,12 +24,12 @@ echo To connect to this session copy-n-paste the following into a terminal: tmate -S /tmp/tmate.sock display -p '#{tmate_ssh}' # Wait for connection to close or timeout in 15 min -timeout=$((2*60)) +timeout=$((15*60)) while [ -S /tmp/tmate.sock ]; do sleep 1 timeout=$(($timeout-1)) - if [ ! -f /tmp/keepalive ] ; then + if [ ! -f /tmp/keepalive ]; then if (( timeout < 0 )); then echo Waiting on tmate connection timed out! exit 1