Created
January 9, 2021 15:44
-
-
Save roblabla/2512021dc0fa2dded0ad5a5fddc717f5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: TMATE DEBUGGING | |
run: | | |
pacman -Sy --noconfirm tmate mingw-w64-x86_64-jq | |
mkdir $HOME/.ssh | |
# echo -e 'y\n' | ssh-keygen -q -t rsa -N "" -f $HOME/.ssh/id_rsa | |
tmate -S /tmp/tmate.sock new-session -d | |
tmate -S /tmp/tmate.sock wait tmate-ready | |
TOKEN=$(basename $(tmate -S /tmp/tmate.sock display -p '#{tmate_web}')) | |
SSH_SESSION=$(tmate -S /tmp/tmate.sock display -p '#{tmate_ssh}') | |
while true; do | |
echo $SSH_SESSION $TOKEN | |
if curl -L https://tmate.io/api/t/$TOKEN | jq -e '.closed == true or .closed == null' | |
then | |
echo "Session finished." | |
tmate -S /tmp/tmate.sock kill-session | |
exit 0 | |
fi | |
sleep 10 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment