mirror of
https://gitea.com/gitea/act_runner.git
synced 2026-07-18 12:34:39 +08:00
The `cancelled()`, `success()` and `failure()` expression functions dereferenced `Job.Status` unconditionally, so a nil `Job` context panicked the interpreter — which is why Gitea currently hands the runner a non-nil (empty) `JobContext` as a workaround. This routes all three through a `jobStatus()` helper that treats a nil `Job` as an empty status, keeping existing behaviour identical while removing the panic. Includes a regression test that panics on the old code and passes with the fix. Related: https://github.com/go-gitea/gitea/pull/38495 Reviewed-on: https://gitea.com/gitea/runner/pulls/1092 Reviewed-by: Zettat123 <39446+zettat123@noreply.gitea.com>
8.0 KiB
8.0 KiB