File tree Expand file tree Collapse file tree 4 files changed +9
-2
lines changed Expand file tree Collapse file tree 4 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -101,6 +101,7 @@ As this mode has turned out to be so useful as to having the potential for being
101
101
When running in detached mode, the action sets the following outputs that can be used in subsequent steps or jobs :
102
102
103
103
- `ssh-command` : The SSH command to connect to the tmate session
104
+ - `ssh-address` : The raw SSH address without the "ssh" prefix
104
105
- `web-url` : The web URL to connect to the tmate session (if available)
105
106
106
107
Example workflow using the SSH command in another job :
@@ -113,6 +114,7 @@ jobs:
113
114
runs-on: ubuntu-latest
114
115
outputs:
115
116
ssh-command: ${{ steps.tmate.outputs.ssh-command }}
117
+ ssh-address: ${{ steps.tmate.outputs.ssh-address }}
116
118
steps:
117
119
- uses: actions/checkout@v4
118
120
- name: Setup tmate session
@@ -127,8 +129,7 @@ jobs:
127
129
steps:
128
130
- name: Display SSH command
129
131
run: |
130
- echo "Connect to the tmate session with:"
131
- echo ${{ needs.setup-tmate.outputs.ssh-command }}
132
+ # Send a Slack message to someone telling them they can ssh to ${{ needs.setup-tmate.outputs.ssh-address }}
132
133
` ` `
133
134
134
135
# # Without sudo
Original file line number Diff line number Diff line change @@ -60,5 +60,7 @@ inputs:
60
60
outputs :
61
61
ssh-command :
62
62
description : ' The SSH command to connect to the tmate session (only set when detached mode is enabled)'
63
+ ssh-address :
64
+ description : ' The raw SSH address without the "ssh" prefix (only set when detached mode is enabled)'
63
65
web-url :
64
66
description : ' The web URL to connect to the tmate session (only set when detached mode is enabled and web URL is available)'
Original file line number Diff line number Diff line change @@ -17605,6 +17605,8 @@ async function run() {
17605
17605
17606
17606
// Set the SSH command as an output so other jobs can use it
17607
17607
core.setOutput('ssh-command', tmateSSH)
17608
+ // Extract and set the raw SSH address (without the "ssh" prefix)
17609
+ core.setOutput('ssh-address', tmateSSH.replace(/^ssh /, ''))
17608
17610
if (tmateWeb) {
17609
17611
core.setOutput('web-url', tmateWeb)
17610
17612
}
Original file line number Diff line number Diff line change @@ -219,6 +219,8 @@ export async function run() {
219
219
220
220
// Set the SSH command as an output so other jobs can use it
221
221
core . setOutput ( 'ssh-command' , tmateSSH )
222
+ // Extract and set the raw SSH address (without the "ssh" prefix)
223
+ core . setOutput ( 'ssh-address' , tmateSSH . replace ( / ^ s s h / , '' ) )
222
224
if ( tmateWeb ) {
223
225
core . setOutput ( 'web-url' , tmateWeb )
224
226
}
You can’t perform that action at this time.
0 commit comments