Skip to content

Commit

Permalink
Update instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
csexton committed Oct 2, 2019
1 parent 5129d1d commit 6448ef8
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 [email protected]
```

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)
Expand Down
4 changes: 2 additions & 2 deletions script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6448ef8

Please sign in to comment.