Skip to content

Commit

Permalink
Merge pull request #18 from telotortium/wait-timeout-minutes
Browse files Browse the repository at this point in the history
Introduce wait-timeout-minutes parameter
  • Loading branch information
lhotari authored Aug 30, 2023
2 parents d23c272 + 58ffe3e commit b0357f2
Show file tree
Hide file tree
Showing 5 changed files with 1,647 additions and 492 deletions.
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,30 @@ jobs:
upterm-server: wss://YOUR_HEROKU_APP_URL
```

## Shut down server if user doesn't connect

If you'd like to shut down the server after a certain number of minutes if no
user connects, use the `wait-timeout-minutes` input parameter. This can be
useful for using `action-upterm` to get a debug shell if your job fails, but
not have the debug shell keep your pipeline running for too long if no one is
interested in debugging it.

```yaml
name: CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup upterm session
uses: lhotari/action-upterm@v1
if: ${{ failure() }}
with:
## If no one connects after 5 minutes, shut down server.
wait-timeout-minutes: 5
```

## Continue a workflow

If you want to continue a workflow and you are inside a upterm session, just create a empty file with the name `continue` either in the root directory or in the workspace directory by running `touch continue` or `sudo touch /continue`.
Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,7 @@ inputs:
description: 'Content for ~/.ssh/known_hosts file on the server'
required: false
default: ''
wait-timeout-minutes:
description: 'Integer number of minutes to wait for user to connect before shutting down server. Once a user connects, the server will stay up.'
required: false
default: ''
Loading

0 comments on commit b0357f2

Please sign in to comment.