An actions runner based on actions/runner for gitea actions
Go to file
Christopher Homberger 08d7044ad1
All checks were successful
build/release / goreleaser (push) Successful in 12m15s
fix: load all env's of .env file for service
2023-12-05 23:10:14 +01:00
.gitea/workflows fix release workflow 2023-07-13 15:48:30 +02:00
.github/workflows Add GitHub Release Workflow 2023-12-04 19:43:03 +01:00
actions/server Add artifact / cache support 2023-07-13 15:37:59 +02:00
client Rename to actions (#7) 2022-12-06 16:37:38 +08:00
cmd fix: load all env's of .env file for service 2023-12-05 23:10:14 +01:00
config cleanup 2023-01-07 13:23:47 +01:00
core cleanup 2023-01-07 13:23:47 +01:00
poller Rename to actions (#7) 2022-12-06 16:37:38 +08:00
register cleanup 2023-01-07 13:23:47 +01:00
runtime fix: call UpdateTask after 1 min of inactivity 2023-12-05 22:30:28 +01:00
.gitignore chore(runner): remove client secret and add UUID in runner 2022-11-24 15:37:38 +08:00
.golangci.yml chore: add .golangci config 2022-11-24 15:36:28 +08:00
.goreleaser.checksum.sh Add .goreleaser.checksum.sh 2023-05-19 02:17:01 +08:00
.goreleaser.yaml remove armv5/v6 2023-05-19 02:16:35 +08:00
actions-runner-worker.ps1 fix pwsh worker exitcode 1 never happend 2023-08-31 18:38:38 +02:00
actions-runner-worker.py fix python worker script exit code 105 is success 2023-08-31 18:44:38 +02:00
go.mod Add experimental service support (#2) 2023-12-04 18:02:59 +01:00
go.sum Add experimental service support (#2) 2023-12-04 18:02:59 +01:00
LICENSE Add license 2022-11-24 15:36:16 +08:00
main.go Remove old code 2023-01-07 12:20:50 +01:00
Makefile chore: Add makefile 2022-11-24 15:37:09 +08:00
README.md fix typo 2023-08-31 16:00:48 +00:00

actions runner

Actions runner is a runner for Gitea based on actions/runner and the workflow yaml parser of act.

  • This runner doesn't download actions via the git http protocol, it downloads them via tar.gz and zip archives.
  • This runner doesn't support absolute actions in composite actions https://github.com/actions/checkout@v3 will only work in workflow steps.
  • This runner doesn't support go actions, however you can create a wrapper composite action as a workaround
  • This runner does support service container
  • This runner does support https://github.com/actions/runner-container-hooks
  • This runner uses the official https://github.com/actions/runner runner to run your steps
  • This runner is a protocol proxy between Gitea Actions and GitHub Actions

Known Issues

  • actions/runner's live logs are skipping lines, but it is not possible to upload the full log without breaking live logs after the steps are finished
  • job outputs cannot be sent back gitea/actions-proto-def#4 fixed
  • Not possible to update display name of steps from runner Pre and Post steps are part of setup and complete job, steps not in the job are ignored by the server

Prerequisites

Quickstart

Build

make build

Register

./act_runner register

And you will be asked to input:

  1. worker args for example python3,actions-runner-worker.py,actions-runner/bin/Runner.Worker, pwsh,actions-runner-worker.ps1,actions-runner/bin/Runner.Worker actions-runner-worker(.ps1/.py) are wrapper scripts to call the actions/runner via the platform specfic dotnet anonymous pipes

    actions-runner-worker.py doesn't work on windows

    On windows you might need to unblock the actions-runner-worker.ps1 script via pwsh Unblock-File actions-runner-worker.ps1 and Runner.Worker needs the .exe suffix. For example on windows use the following worker args pwsh,actions-runner-worker.ps1,actions-runner/bin/Runner.Worker.exe

  2. Gitea instance URL, like http://192.168.8.8:3000/. You should use your gitea instance ROOT_URL as the instance argument and you should not use localhost or 127.0.0.1 as instance IP;

  3. Runner token, you can get it from http://192.168.8.8:3000/admin/runners;

  4. Runner name, you can just leave it blank;

  5. Runner labels, you can just leave it blank.

The process looks like:

INFO Registering runner, arch=amd64, os=darwin, version=0.1.5.
INFO Enter the worker args for example pwsh,actions-runner-worker.ps1,actions-runner/bin/Runner.Worker:
pwsh,actions-runner-worker.ps1,actions-runner/bin/Runner.Worker
INFO Enter the Gitea instance URL (for example, https://gitea.com/):
http://192.168.8.8:3000/
INFO Enter the runner token:
fe884e8027dc292970d4e0303fe82b14xxxxxxxx
INFO Enter the runner name (if set empty, use hostname:Test.local ):

INFO Enter the runner labels, leave blank to use the default labels (comma-separated, for example, self-hosted,ubuntu-latest):

INFO Registering runner, name=Test.local, instance=http://192.168.8.8:3000/, labels=[self-hosted ubuntu-latest].
DEBU Successfully pinged the Gitea instance server
INFO Runner registered successfully.

You can also register with command line arguments.

./act_runner register --instance http://192.168.8.8:3000 --token <my_runner_token> --worker pwsh,actions-runner-worker.ps1,actions-runner/bin/Runner.Worker --no-interactive
./act_runner register --instance http://192.168.8.8:3000 --token <my_runner_token> --worker python3,actions-runner-worker.py,actions-runner/bin/Runner.Worker --no-interactive

If the registry succeed, you could run the runner directly.

Run

./act_runner daemon