Skip to content

Commit c606f86

Browse files
authored
Merge pull request #218 from mxschmitt/detached
Add a "sub-Action" for the detached mode by default
2 parents c6f0481 + 7eae436 commit c606f86

File tree

3 files changed

+62
-3
lines changed

3 files changed

+62
-3
lines changed

.github/workflows/manual-detached-test.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@ jobs:
66
runs-on: ubuntu-latest
77
steps:
88
- uses: actions/checkout@v4
9-
- uses: ./
9+
- uses: ./detached
1010
with:
11-
limit-access-to-actor: true
12-
detached: true
1311
connect-timeout-seconds: 60
1412
- run: |
1513
echo "A busy loop"

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ jobs:
9494

9595
By default, this mode will wait at the end of the job for a user to connect and then to terminate the tmate session. If no user has connected within 10 minutes after the post-job step started, it will terminate the `tmate` session and quit gracefully.
9696

97+
As this mode has turned out to be so useful as to having the potential for being the default mode once time travel becomes available, it is also available as `mxschmitt/action-tmate/detached` for convenience.
98+
9799
## Without sudo
98100

99101
By default we run installation commands using sudo on Linux. If you get `sudo: not found` you can use the parameter below to execute the commands directly.

detached/action.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: 'Debugging with tmate'
2+
description: 'Debug your GitHub Actions Environment interactively by using SSH or a Web shell'
3+
branding:
4+
icon: terminal
5+
author: 'Max Schmitt'
6+
runs:
7+
using: 'node20'
8+
main: '../lib/index.js'
9+
post: '../lib/index.js'
10+
post-if: '!cancelled()'
11+
inputs:
12+
sudo:
13+
description: 'If apt should be executed with sudo or without'
14+
required: false
15+
default: 'auto'
16+
install-dependencies:
17+
description: 'Whether or not to install dependencies for tmate on linux (openssh-client, xz-utils)'
18+
required: false
19+
default: 'true'
20+
limit-access-to-actor:
21+
description: 'Whether to authorize only the public SSH keys of the user triggering the workflow (defaults to true if the GitHub profile of the user has a public SSH key)'
22+
required: false
23+
default: 'auto'
24+
detached:
25+
description: 'In detached mode, the workflow job will continue while the tmate session is active'
26+
required: false
27+
default: 'true'
28+
connect-timeout-seconds:
29+
description: 'How long in seconds to wait for a connection to be established'
30+
required: false
31+
default: '600'
32+
tmate-server-host:
33+
description: 'The hostname for your tmate server (e.g. ssh.example.org)'
34+
required: false
35+
default: ''
36+
tmate-server-port:
37+
description: 'The port for your tmate server (e.g. 2222)'
38+
required: false
39+
default: ''
40+
tmate-server-rsa-fingerprint:
41+
description: 'The RSA fingerprint for your tmate server'
42+
required: false
43+
default: ''
44+
tmate-server-ed25519-fingerprint:
45+
description: 'The ed25519 fingerprint for your tmate server'
46+
required: false
47+
default: ''
48+
msys2-location:
49+
description: 'The root of the MSYS2 installation (on Windows runners)'
50+
required: false
51+
default: 'C:\msys64'
52+
github-token:
53+
description: >
54+
Personal access token (PAT) used to call into GitHub's REST API.
55+
We recommend using a service account with the least permissions necessary.
56+
Also when generating a new PAT, select the least scopes necessary.
57+
[Learn more about creating and using encrypted secrets](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets)
58+
default: ${{ github.token }}
59+

0 commit comments

Comments
 (0)