runnner

982f645 · gmorell · 2026-05-25 16:33

1 files +9 -7

Files changed

modified lib/git_gud/workflows/runner_payload.ex
+9 −7
@@ -3,10 +3,13 @@ defmodule GitGud.Workflows.RunnerPayload do
3 3 Encodes a `WorkflowJob` into the `workflow_payload` bytes that
4 4 forgejo-runner expects.
5 5
6 Format on the wire: `gzip(YAML)` of the workflow document scoped to
7 the one job the runner is about to execute. Forgejo-runner does the
8 decompression and hands the YAML to its embedded `act` engine, which
9 is built for GitHub Actions workflow syntax.
6 + Format on the wire: **plain YAML bytes** of the workflow document
7 + scoped to the one job the runner is about to execute. v12.10.1's
8 + `internal/app/run/runner.go` reads `task.WorkflowPayload` directly
9 + as a UTF-8 string and feeds it to the act engineno
10 + decompression. Earlier versions of this module gzip'd; the runner
11 + treated the gzip magic bytes as control characters in YAML and
12 + rejected the task with "yaml: control characters are not allowed".
10 13
11 14 We snapshot the parsed YAML at run-creation time as
12 15 `WorkflowJob.definition` (the raw map). Here we shrink it back to a
@@ -16,7 +19,7 @@ defmodule GitGud.Workflows.RunnerPayload do
16 19 alias GitGud.Workflows.WorkflowJob
17 20 alias GitGud.Workflows.WorkflowRun
18 21
19 @doc "Return gzip'd YAML bytes ready to hand to forgejo-runner."
22 + @doc "Return plain YAML bytes ready to hand to forgejo-runner."
20 23 def encode(%WorkflowJob{} = job) do
21 24 run = GitGud.Repo.get!(WorkflowRun, job.workflow_run_id)
22 25
@@ -28,7 +31,6 @@ defmodule GitGud.Workflows.RunnerPayload do
28 31 }
29 32 }
30 33
31 yaml = Ymlr.document!(workflow_doc)
32 :zlib.gzip(yaml)
34 + Ymlr.document!(workflow_doc)
33 35 end
34 36 end

Parents: 4dd3a32