mxschmitt / action-tmate

Debug your GitHub Actions via SSH by using tmate to get access to the runner system itself.
https://mxschmitt.github.io/action-tmate/
MIT License
2.86k stars 285 forks source link

Don't get connection url only ssh #163

Open Set27 opened 1 year ago

Set27 commented 1 year ago
ssh sW6PKcxdvfcrKfjHFcCZ9dKqy@sfo2.tmate.io

Warning: The `save-state` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
SSH: ssh sW6PKcxdvfcrKfjHFcCZ9dKqy@sfo2.tmate.io
or: ssh -i <path-to-private-SSH-key> sW6PKcxdvfcrKfjHFcCZ9dKqy@sfo2.tmate.io
SSH: ssh sW6PKcxdvfcrKfjHFcCZ9dKqy@sfo2.tmate.io
or: ssh -i <path-to-private-SSH-key> sW6PKcxdvfcrKfjHFcCZ9dKqy@sfo2.tmate.io
SSH: ssh sW6PKcxdvfcrKfjHFcCZ9dKqy@sfo2.tmate.io
or: ssh -i <path-to-private-SSH-key> sW6PKcxdvfcrKfjHFcCZ9dKqy@sfo2.tmate.io
SSH: ssh sW6PKcxdvfcrKfjHFcCZ9dKqy@sfo2.tmate.io
or: ssh -i <path-to-private-SSH-key> sW6PKcxdvfcrKfjHFcCZ9dKqy@sfo2.tmate.io
SSH: ssh sW6PKcxdvfcrKfjHFcCZ9dKqy@sfo2.tmate.io
or: ssh -i <path-to-private-SSH-key> sW6PKcxdvfcrKfjHFcCZ9dKqy@sfo2.tmate.io
SSH: ssh sW6PKcxdvfcrKfjHFcCZ9dKqy@sfo2.tmate.io
or: ssh -i <path-to-private-SSH-key> sW6PKcxdvfcrKfjHFcCZ9dKqy@sfo2.tmate.io
SSH: ssh sW6PKcxdvfcrKfjHFcCZ9dKqy@sfo2.tmate.io
or: ssh -i <path-to-private-SSH-key> sW6PKcxdvfcrKfjHFcCZ9dKqy@sfo2.tmate.io
SSH: ssh sW6PKcxdvfcrKfjHFcCZ9dKqy@sfo2.tmate.io
or: ssh -i <path-to-private-SSH-key> sW6PKcxdvfcrKfjHFcCZ9dKqy@sfo2.tmate.io
SSH: ssh sW6PKcxdvfcrKfjHFcCZ9dKqy@sfo2.tmate.io
or: ssh -i <path-to-private-SSH-key> sW6PKcxdvfcrKfjHFcCZ9dKqy@sfo2.tmate.io
SSH: ssh sW6PKcxdvfcrKfjHFcCZ9dKqy@sfo2.tmate.io
or: ssh -i <path-to-private-SSH-key> sW6PKcxdvfcrKfjHFcCZ9dKqy@sfo2.tmate.io
SSH: ssh sW6PKcxdvfcrKfjHFcCZ9dKqy@sfo2.tmate.io
or: ssh -i <path-to-private-SSH-key> sW6PKcxdvfcrKfjHFcCZ9dKqy@sfo2.tmate.io
SSH: ssh sW6PKcxdvfcrKfjHFcCZ9dKqy@sfo2.tmate.io
or: ssh -i <path-to-private-SSH-key> sW6PKcxdvfcrKfjHFcCZ9dKqy@sfo2.tmate.io
SSH: ssh sW6PKcxdvfcrKfjHFcCZ9dKqy@sfo2.tmate.io
or: ssh -i <path-to-private-SSH-key> sW6PKcxdvfcrKfjHFcCZ9dKqy@sfo2.tmate.io
SSH: ssh sW6PKcxdvfcrKfjHFcCZ9dKqy@sfo2.tmate.io
or: ssh -i <path-to-private-SSH-key> sW6PKcxdvfcrKfjHFcCZ9dKqy@sfo2.tmate.io
SSH: ssh sW6PKcxdvfcrKfjHFcCZ9dKqy@sfo2.tmate.io
or: ssh -i <path-to-private-SSH-key> sW6PKcxdvfcrKfjHFcCZ9dKqy@sfo2.tmate.io
SSH: ssh sW6PKcxdvfcrKfjHFcCZ9dKqy@sfo2.tmate.io
or: ssh -i <path-to-private-SSH-key> sW6PKcxdvfcrKfjHFcCZ9dKqy@sfo2.tmate.io
SSH: ssh sW6PKcxdvfcrKfjHFcCZ9dKqy@sfo2.tmate.io
or: ssh -i <path-to-private-SSH-key> sW6PKcxdvfcrKfjHFcCZ9dKqy@sfo2.tmate.io
SSH: ssh sW6PKcxdvfcrKfjHFcCZ9dKqy@sfo2.tmate.io
or: ssh -i <path-to-private-SSH-key> sW6PKcxdvfcrKfjHFcCZ9dKqy@sfo2.tmate.io
SSH: ssh sW6PKcxdvfcrKfjHFcCZ9dKqy@sfo2.tmate.io
or: ssh -i <path-to-private-SSH-key> sW6PKcxdvfcrKfjHFcCZ9dKqy@sfo2.tmate.io
SSH: ssh sW6PKcxdvfcrKfjHFcCZ9dKqy@sfo2.tmate.io
or: ssh -i <path-to-private-SSH-key> sW6PKcxdvfcrKfjHFcCZ9dKqy@sfo2.tmate.io
SSH: ssh sW6PKcxdvfcrKfjHFcCZ9dKqy@sfo2.tmate.io
or: ssh -i <path-to-private-SSH-key> sW6PKcxdvfcrKfjHFcCZ9dKqy@sfo2.tmate.io
SSH: ssh sW6PKcxdvfcrKfjHFcCZ9dKqy@sfo2.tmate.io
or: ssh -i <path-to-private-SSH-key> sW6PKcxdvfcrKfjHFcCZ9dKqy@sfo2.tmate.io
SSH: ssh sW6PKcxdvfcrKfjHFcCZ9dKqy@sfo2.tmate.io
or: ssh -i <path-to-private-SSH-key> sW6PKcxdvfcrKfjHFcCZ9dKqy@sfo2.tmate.io
SSH: ssh sW6PKcxdvfcrKfjHFcCZ9dKqy@sfo2.tmate.io
or: ssh -i <path-to-private-SSH-key> sW6PKcxdvfcrKfjHFcCZ9dKqy@sfo2.tmate.io
SSH: ssh sW6PKcxdvfcrKfjHFcCZ9dKqy@sfo2.tmate.io

when I try to connect via console it's also failed

mxschmitt commented 1 year ago

How does your workflow file look like?

Set27 commented 1 year ago

How does your workflow file look like?


name: CI

on:
  push:
    branches: [ "main" ]
  pull_request:
    branches: [ "main" ]

env:
  ACTIONS_STEP_DEBUG: true

jobs:
  validate-backend:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2

      - name: Fetch secrets from tawbar
        run: |
          curl 
          curl
      - name: Build docker images
        run: docker compose build backend

      - name: Install gems
        run: bin/backend/bundle install

      - name: Run rubocop
        run: bin/backend/lint

      - name: Prepare database
        run: bin/backend/run "bundle exec rake db:prepare"

      - name: Setup tmate session
        uses: mxschmitt/action-tmate@v3.16

      - name: Run tests
        run: bin/backend/test

  validate-frontend:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2

      - name: Fetch secrets from tawbar
        run: |
          curl
          curl
      - name: Build docker images
        run: docker compose build --build-arg UID=$UID frontend

      - name: Install dependencies
        run: bin/frontend/yarn install

      - name: Build vite
        run: bin/frontend/yarn build

      - name: Run svelte-check
        run: bin/frontend/check

      - name: Run linter
        run: bin/frontend/lint
memchr commented 1 year ago

I'm also getting this behaviour when using the Arch container. Just ssh commands spamming out output in quick succession, and they don't work. Can be produced by this minial workflow

name: test
on:
  workflow_dispatch:

jobs:
  tmate_test:
    runs-on: ubuntu-22.04
    container: 
      image: archlinux:base-devel 
    steps
      - name: Setup tmate session
        uses: mxschmitt/action-tmate@v3
memchr commented 1 year ago

Oops, I just found out that this action uses the ssh public key from the github account as authorised_keys. And since I changed my ~/.ssh/config to make ssh use ${HOME}/.ssh/github for host github.com, which is different from the default private key used for tmate.io, ssh is unable to connect to the tmate.io ssh link. And I think this is also the reason why the http link does not work.

ssh -G github.com | grep identityfile 
identityfile ${HOME}/.ssh/github

Finally, I need to use the -i flag to specify which private key to use.

ssh -i github AbcDeFgHijklMe@nyc1.tmate.io

Sorry for the confusion.