作为自主托管的运行程序
A reverse engineered github actions compatible self-hosted runner using nektos/act to execute your workflow steps. Unlike the official actions/runner, this works on more systems like freebsd.
| Actions Type | Host | JobContainer (only Linux, Windows, macOS) |
|---|---|---|
| (composite) run steps | bash (preferred), sh or explicit shell in your PATH (prior running the runner). On windows are pwsh (preferred) and powershell the default shells instead of bash or sh |
Docker (*1), sh or explicit shell in your PATH (inside your container image) |
| nodejs actions | node (*2) in your PATH (prior running the runner) |
Docker (*1), node (*2) in your PATH (inside your container image) |
| docker actions | Not available | Docker (*1) |
| service container | Not available | Docker (*1) v0.7.0 |
| composite actions with uses | v0.1.0 | v0.1.0 |
| composite actions with if | v0.1.0 | v0.1.0 |
| composite actions with continue-on-error | v0.1.0 | v0.1.0 |
(*1) Reachable docker daemon use DOCKER_HOST to specify a remote host.
(*2) For best compatibility with existing nodejs actions, please add nodejs in version 20 to your PATH, newer nodejs versions might lead to workflow failures.
Follow the instruction of https://github.com/ChristopherHX/github-act-runner/releases/latest.
/etc/apt/sources.list.d/github-act-runner.list file:
deb https://gagis.hopto.org/repo/chrishx/deb all maincurl -sS https://gagis.hopto.org/repo/chrishx/pubkey.gpg | sudo tee -a /etc/apt/trusted.gpg.d/chrishx-github-act-runner.ascsudo apt update
sudo apt install github-act-runnergithub-act-runner new --url --name --labels --token where
https://github.com/user/repo), organization (e.g. https://github.com/organization) or enterprise URLlabel1,label2. Optional.The new runner will be registered and started as background service.
See help:
github-act-runner --helpFor more info about managing runners.
You need at least go 1.21 to use this runner from source.
git clone https://github.com/ChristopherHX/github-act-runner.git --recursivegit pull
git submodule updatego run . configure --url --name -l label1,label2 --token E.g. https://github.com/ChristopherHX/github-act-runner for this repo
E.g. Test
| You find the token in | |
|---|---|
| Repository | /settings/actions/runners/new |
| Organization | /organizations//settings/actions/runners/new |
| Enterprise | In action runner settings of your enterprise |
E.g. AWWWWWWWWWWWWWAWWWWWWAWWWWWWW
Replace label1,label2 with a custom list of runner labels.
go run . runrunner.os changed from darwin to macOSrunner.arch changed from x86_64 to x64runner.arch changed from 386 to x86runner.arch changed from aarch64 to arm64shell parameter might behave differentlynektos/act@65ef31f102ceb75623973921099454637bab55b0pwsh and powershell as default shell, while running directly on windowssh if bash is not foundprotocol.JobLogger moved to "protocol/logger" packagenektos/act@f3350e2acbd2812cf3dd9bd8324387be05fce755continue-on-error: trueadd-mask command not implementedwith and env (also applies to workflow and job env blocks) keys / directly assign to a mapping expression are not implementednode program yourself in all containers / host configurationsThis runner implements the same protocol as the actions/runner in a different way, as such it can be used as a self-hosted runner exactly like the official one. To get this working, I initially built an actions service replacement ChristopherHX/runner.server for the official actions/runner. My own actions service allowed me to implement the base protocol for this runner and debug how the protocol is serializeing and parsing json messages, while still being incompatible with github. After testing against github, the first thing happend was loosing the ability to run any github action workflows on my test repository. My invalid attempts to register a custom runner caused unrecoverable Internal Server Errors on githubs side, I decided to delete this test repository. After some work everything worked and finally it is safe to register this runner against github. To execute steps this runner translates the github actions job request to be compatible with a modified version of nektos/act ( actions-oss/act-cli ), which adds a local task runner without the need for docker and increased platform support, also the log output of act gets redirected to github for live logs and storing log files.
Yes, you can use this runner together with ChristopherHX/runner.server locally on your PC without depending on compatibility with github. Also CI tests for this runner are using ChristopherHX/runner.server, this avoids requiring a PAT for github to run tests and ensures that you are always able to run it locally without github.
暂无开放 Issues,或尚未同步最近议题。