From bfeb23ce06d8ef9e99387fbf3e94d0d8f2dac125 Mon Sep 17 00:00:00 2001 From: atlas Date: Mon, 15 Jun 2026 10:13:24 +0200 Subject: [PATCH] fix(forge): pre-create Actions artifact storage dir so uploads persist Forgejo's local Actions-artifact storage defaults to /var/lib/forgejo/data/actions_artifacts but Forgejo does not pre-create it. The artifact endpoint ingests the chunked upload, then the merge-chunks step fails with 'lstat .../actions_artifacts/tmpNNN: no such file or directory', so every upload-artifact step dies after a successful build. Pre-create the dir (forgejo-owned) via tmpfiles. actions.ENABLED already registers the endpoints; this gives them somewhere to write. --- nix/modules/hive-forge.nix | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/nix/modules/hive-forge.nix b/nix/modules/hive-forge.nix index 538ae634..d81921a8 100644 --- a/nix/modules/hive-forge.nix +++ b/nix/modules/hive-forge.nix @@ -324,6 +324,24 @@ in pkgs.gnupg ]; + # Forgejo's local Actions-artifact storage defaults to + # `{APP_DATA_PATH}/actions_artifacts` (= + # `/var/lib/forgejo/data/actions_artifacts`), but Forgejo does not + # pre-create that directory. The artifact endpoint ingests the + # chunked upload, then the merge-chunks step does an `lstat` on a + # tmp dir under it and fails: + # Error merge chunks: lstat + # /var/lib/forgejo/data/actions_artifacts/tmpNNN: no such file or + # directory + # so every `upload-artifact` step dies after the build succeeds. + # Pre-create the dir (forgejo-owned) so uploads actually persist. + # `actions.ENABLED = true` registers the endpoints; this gives them + # somewhere to write. + systemd.tmpfiles.rules = [ + "d /var/lib/forgejo/data 0750 forgejo forgejo - -" + "d /var/lib/forgejo/data/actions_artifacts 0750 forgejo forgejo - -" + ]; + # Ensure Forgejo has a usable GPG signing key so UI merges / CRUD # commits are signed instead of erroring "does not have a signing # key". This service (a) generates a key in forgejo's persistent