使用长亭Collie来trick github action获取一个为期最长6小时的国外主机
作者:Sec-Labs | 发布时间:
项目地址
https://github.com/DVKunion/collie_tricker
Collie Tricker
通过 GitHub Action 白嫖国外主机。
使用方式
- 注册百川-使用牧云主机管理助手

- 点击绑定主机

- 获取token

- 在github创建一个空的仓库,clone到本地,并创建
.github/workflows/workflow.yml文件,写入一下参考内容:name: example on: [ push, pull_request ] jobs: runner: runs-on: ubuntu-latest # 选择你想要的主机系统如:ubuntu:20.04 steps: - uses: actions/checkout@v3 - name: collie uses: dvkunion/collie_tricker@main with: token: xxxxxx # your token, It will be safer to use ${{ secrets.token }}, see [https://docs.github.com/actions/security-guides/encrypted-secrets] -
git push 上去代码,触发action。
-
返回百川界面,已获取到主机。

- 后续使用时可以通过手动触发action的方式。
一些更有趣的玩法
一些更便捷的方式,如果需求的人多会逐步加入到demo。
- 可以使用github action 的
on:workflow_dispatch,通过http请求触发ci,来实现主机上线控制。 - 也可以将token参数作为input。在每次http请求时动态带上token, 方便操作。
标签:工具分享