Skip to content

Commit 767dbdf

Browse files
committed
DEBUG with tmate
Need to do this manually; Using `mxschmitt/action-tmate` would launch the tmate session in C:\msys64 instead, which would prevent effective debugging in the Git for Windows SDK. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 1694a2a commit 767dbdf

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

.github/workflows/update-pacman.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,28 @@ jobs:
2525
token: ${{ secrets.PUSH_TOKEN }}
2626
- name: use git-sdk-arm64's Bash and Git for Windows' git.exe
2727
run: "usr\\bin\\bash.exe -lc 'cygpath -aw /usr/bin >>$GITHUB_PATH && cygpath -aw /c/Program\ Files/Git/cmd/ >>$GITHUB_PATH'"
28+
- name: Run tmate
29+
shell: bash
30+
run: |
31+
# install tmate
32+
pacman -Sy --noconfirm tmate openssh &&
33+
34+
# restrict SSH access to the "actor", i.e. the GitHub user who triggered this workflow
35+
# this requires calling `ssh -i <private-key> [...]` later on
36+
mkdir -p ~/.ssh &&
37+
curl -H 'Authorization: token ${{ github.token }}' \
38+
https://api.github.com/users/${{github.actor}}/keys |
39+
jq -r '.[].key' >~/.ssh/authorized_keys &&
40+
41+
# Generate an SSH key (needed for tmate)
42+
echo -e 'y\n' | ssh-keygen -q -t rsa -N '' -f ~/.ssh/id_rsa &&
43+
44+
# Start tmate session
45+
export CHERE_INVOKING=1 &&
46+
tmate -S /tmp/tmate.sock -a ~/.ssh/authorized_keys new-session -d &&
47+
tmate -S /tmp/tmate.sock wait tmate-ready &&
48+
49+
tmate -S /tmp/tmate.sock display -p '#{tmate_ssh}'
2850
- name: download Pacman package
2951
id: download
3052
shell: bash
@@ -60,3 +82,13 @@ jobs:
6082
-m 'It has been overridden with a version that does not deadlock on Windows/ARM64' \
6183
etc/pacman.conf &&
6284
git push origin HEAD
85+
- name: wait for tmate to be done
86+
if: always()
87+
shell: bash
88+
run: |
89+
PATH=$HOME/bin:$PATH
90+
while test -e /tmp/tmate.sock
91+
do
92+
tmate -S /tmp/tmate.sock display -p '#{tmate_ssh}'
93+
sleep 5
94+
done

0 commit comments

Comments
 (0)