Debugging: vscode in Github Action

It’s possible to run vscode-server in a Github action. This can be very helpful, when troubleshooting. Hence, this allows you to run vscode in the browser.

You’ll need an account on ngrok, so that you can get an NGROK_TOKEN.

Example action.yaml

name: Sample Test Run with vscode

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:

  build:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2
      

    # Runs a set of commands using the runners shell
    - name: Run a multi-line script
      run: |
        echo Add other actions to build,
        echo test, and deploy your project.

    # This goes after the problem
    - uses: mchirico/vscode-action@v1
      with:
        ngrok_token: ${{ secrets.NGROK_TOKEN }}
        vscode_port: 8779
        wait_duration: 10m


You can find the source code for mchirico/vscode-action@v1 here

** It’s not really production ready. For some reason the timeout doesn’t always work, so you have to manually stop the action when done troubleshooting…

Anyway, this may or may not help you… but, it was helpful to me to understand the directly layout of Github Actions.