Closes many small gaps between how workflows run on GitHub and on the runner, each checked against GitHub's runner and live runs.
- `action.yml` expressions are checked against the contexts GitHub allows per field, and input defaults are evaluated with those contexts only
- Reusable workflows take inputs from `workflow_call` only, evaluate outputs once after all called jobs finish, stop at 10 nested workflows and resolve relative `./` paths in remote workflows against that workflow's repository
- A called job failing under `continue-on-error` no longer fails the caller, and same-repository calls use their own clone cache
- Job timeouts cancel the job with GitHub's message, step timeouts fail the step with GitHub's message, and invalid `timeout-minutes` values behave like on GitHub
- `runner.timeout` expiry names the setting and server cancellation is logged
- Matrix and strategy evaluation errors fail the job
- `exec` records skipped jobs and sets `github.run_attempt`, `workflow_ref` and `workflow_sha`
- `runs-on` expressions keep their types
- Step summaries upload as each step ends
- Docker actions join the job network, and the job container no longer gets a network alias from the job name
- Container, network and volume names are unique per job invocation
- Cached images are matched against the daemon's platform and Dockerfile actions build for the requested platform
- `runner.arch` maps 32-bit ARM and x86 names like GitHub
- Pinned action SHAs are verified and git replace objects are ignored
- `hashFiles` uses GitHub's current bundle
- Registration trims labels and writes `.runner` as `0600`
- The container entrypoint quotes its arguments and reads the registration token from the environment or a file
- The systemd example uses `KillMode=mixed` so running jobs can finish on stop
- The cache server releases its database between eviction batches
- Shared rules come from actionslib v1.7.0, added in https://gitea.com/gitea/actionslib/pulls/34
_Written by Claude (Opus 5.5)._
Reviewed-on: https://gitea.com/gitea/runner/pulls/1421
Reviewed-by: bircni <bircni@icloud.com>
Co-authored-by: silverwind <me@silverwind.io>
`gitea-runner register` pinged the instance in an unbounded loop, so a permanent failure like an untrusted certificate or a wrong URL never returned. It now pings once and returns the error, like other one-shot commands.
The image entrypoint keeps retrying registration indefinitely by default, like the daemon, so a container without a restart policy still recovers once Gitea is reachable. `GITEA_MAX_REG_ATTEMPTS` had no effect because its counter was incremented outside the loop. When set, it now caps the attempts, after which the entrypoint exits non-zero.
Fixes: https://gitea.com/gitea/runner/issues/1195
Co-authored-by: silverwind <me@silverwind.io>
Reviewed-on: https://gitea.com/gitea/runner/pulls/1197
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: silverwind <2021+silverwind@noreply.gitea.com>
Co-authored-by: bircni <bircni@icloud.com>
The Docker entrypoint always checked `.runner` in `/data` and ignored `runner.file` from `CONFIG_FILE`. When `runner.file` pointed elsewhere, it re-registered on every start, or skipped registration because of a stale `.runner`. It now reads the path from a new `config runner-file` subcommand, which resolves `runner.file` the same way as `register` and `daemon`.
Closes https://gitea.com/gitea/runner/issues/585
---------
Co-authored-by: silverwind <me@silverwind.io>
Reviewed-on: https://gitea.com/gitea/runner/pulls/1259
Reviewed-by: silverwind <2021+silverwind@noreply.gitea.com>
Added environment variable `RUNNER_STATE_FILE` to let users specify
where `run.sh` looks for the runner JSON file. Defaults to ``.runner``
to preserve the original behavior.
Addresses issue #368. It's not my preferred solution but it's the least invasive one I can think of.
I'm happy to make any changes you want.
I didn't see an appropriate place to reference the change in the documentation. I will add documentation wherever you think is appropriate.
To test this I did the following:
* Built an image with the `make docker` command and pushed it to my private registry.
* Added that private image as the image in my existing docker stack that was exhibiting the behavior described in #368.
* Added the RUNNER_STATE_FILE environment variable pointing to the runner JSON file set in my `config.yml` (``/data/runner.json`` in this case).
* Configured a new runner in gitea and added the token as an environment variable in the stack config.
* Deployed the stack and verified the new runner was recognized (in the idle state).
* Force updated the runner service to restart the container.
* Verified the same runner was still recognized in gitea (in the idle state) once it was back up and running.
Here is the relevant config. It's stored as a template so I've left the things that would normally be redacted as they are in the template.
```
runner:
image: hub.hax.in.net/haxwithaxe/act_runner:dev1
networks:
- swarm-net
environment:
RUNNER_STATE_FILE: /data/runner.json
CONFIG_FILE: /data/config.yml
GITEA_INSTANCE_URL: "https://git_gitea"
GITEA_RUNNER_REGISTRATION_TOKEN: "{{ git_runner_reg_token }}"
GITEA_RUNNER_NAME: "git_runner"
volumes:
- runner_data:/data
- /var/run/docker.sock:/var/run/docker.sock
```
`runner_data` is a glusterfs subvolume
Thanks for creating this gitea specific fork. Apart from the issue this pull request addresses it works so well I don't have to think about it once it's set up.
Co-authored-by: haxwithaxe <spam@haxwithaxe.net>
Reviewed-on: https://gitea.com/gitea/act_runner/pulls/377
Co-authored-by: haxwithaxe <haxwithaxe@noreply.gitea.com>
Co-committed-by: haxwithaxe <haxwithaxe@noreply.gitea.com>