Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

github 在线调试 #539

Open
supperthomas opened this issue Aug 29, 2024 · 5 comments
Open

github 在线调试 #539

supperthomas opened this issue Aug 29, 2024 · 5 comments

Comments

@supperthomas
Copy link
Owner

  1. 在线调试

在使用 GitHub Actions 的过程中,如果需要登录到 Runner 上调试命令,那么下面这个技巧你一定会感兴趣。

  • uses: shaowenchen/debugger-action@v2 name: debugger timeout-minutes: 30 continue-on-error: true with: ngrok_token: ${{ secrets.NGROK_TOKEN }}

只需要去 Ngrok 官网申请一个 token,就可以通过 ssh 远程登录到 Runner。当然,也可以暴露 Runner 上的服务,提供外网访问的链接,最长可达 6 小时。

在执行日志中,我们可以找到 ssh 的登录链接,使用 root/root 即可登录 Runner。如果配置了 web 的端口映射,还可以查看到相关的服务链接。

@supperthomas
Copy link
Owner Author

@supperthomas
Copy link
Owner Author

@supperthomas
Copy link
Owner Author

@supperthomas
Copy link
Owner Author

@supperthomas
Copy link
Owner Author

name: Ubuntu
on:
  workflow_dispatch:
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Setup Debug Session
        uses: csexton/debugger-action@master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant