Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/manual-detached-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ jobs:
with:
limit-access-to-actor: true
detached: true
connect-timeout-seconds: 60
- run: |
echo "A busy loop"
for value in $(seq 10)
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ jobs:
## Only on failure
By default a failed step will cause all following steps to be skipped. You can specify that the tmate session only starts if a previous step [failed](https://docs.github.com/en/actions/learn-github-actions/expressions#failure).

<!--
{% raw %}
-->
```yaml
name: CI
on: [push]
Expand All @@ -144,6 +147,9 @@ jobs:
if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3
```
<!--
{% endraw %}
-->

## Use registered public SSH key(s)

Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ inputs:
description: 'In detached mode, the workflow job will continue while the tmate session is active'
required: false
default: 'false'
connect-timeout-seconds:
description: 'How long in seconds to wait for a connection to be established'
required: false
default: '600'
tmate-server-host:
description: 'The hostname for your tmate server (e.g. ssh.example.org)'
required: false
Expand Down
8 changes: 7 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17435,7 +17435,13 @@ async function run() {
&& '0' !== await execShellCommand(`${tmate} display -p '#{tmate_num_clients}'`, { quiet: true })
}
})()
for (let seconds = 10 * 60; seconds > 0; ) {

let connectTimeoutSeconds = parseInt(core.getInput("connect-timeout-seconds"))
if (Number.isNaN(connectTimeoutSeconds) || connectTimeoutSeconds <= 0) {
connectTimeoutSeconds = 10 * 60
}

for (let seconds = connectTimeoutSeconds; seconds > 0; ) {
console.log(`${
await hasAnyoneConnectedYet()
? 'Waiting for session to end'
Expand Down
148 changes: 74 additions & 74 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,13 @@ export async function run() {
&& '0' !== await execShellCommand(`${tmate} display -p '#{tmate_num_clients}'`, { quiet: true })
}
})()
for (let seconds = 10 * 60; seconds > 0; ) {

let connectTimeoutSeconds = parseInt(core.getInput("connect-timeout-seconds"))
if (Number.isNaN(connectTimeoutSeconds) || connectTimeoutSeconds <= 0) {
connectTimeoutSeconds = 10 * 60
}

for (let seconds = connectTimeoutSeconds; seconds > 0; ) {
console.log(`${
await hasAnyoneConnectedYet()
? 'Waiting for session to end'
Expand Down