-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
41 lines (34 loc) · 1.56 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# Copyright (c) 2022 OpenFaaS Ltd
name: 'block-with-tmux'
description: 'block-with-tmux'
branding:
icon: 'arrow-right-circle'
color: 'gray-dark'
runs:
using: 'composite'
steps:
- name: Install tmux
shell: bash
id: install-tmux
run: |
if ! [ -x "$(command -v tmux)" ]; then
echo Installing tmux
sudo apt update -qqqy && sudo apt install -qqqy tmux
fi
- name: Block until tmux session is closed
shell: bash
id: tmux-wait-until-closed
run: |
echo "#!/bin/bash" | sudo tee -a /usr/local/bin/unblock
echo "tmux kill-session" | sudo tee -a /usr/local/bin/unblock
sudo chmod +x /usr/local/bin/unblock
cat << EOF | sudo tee /etc/motd
┏━┓┏━┓╻ ╻ ┏┓ ╻ ╻ ┏━┓┏━╸╺┳╸╻ ╻┏━┓╺┳╸┏━╸╺┳┓ ╺┳┓┏━╸╻ ╻
┗━┓┗━┓┣━┫ ┣┻┓┗┳┛ ┣━┫┃ ┃ ┃ ┃┣━┫ ┃ ┣╸ ┃┃ ┃┃┣╸ ┃┏┛
┗━┛┗━┛╹ ╹ ┗━┛ ╹ ╹ ╹┗━╸ ╹ ┗━┛╹ ╹ ╹ ┗━╸╺┻┛╹╺┻┛┗━╸┗┛
A tmux session is running in the background, you can attach with
"tmux attach". To stop this host, run "unblock" or "tmux kill-session".
EOF
tmux new-session -d -s debug
# Blocks until someone has attached to the session and closed it
tmux wait-for channel