From 21746b188d1e13b8234e830c0396366c73f02562 Mon Sep 17 00:00:00 2001 From: Jorijn van der Graaf Date: Sat, 3 Oct 2026 14:40:09 +0200 Subject: [PATCH] fix(ci): initialise the published repo when its directory is empty The publish step created the OSTree repo only when the directory was missing. On the runner host the web root exists before the first publish, as an empty directory, so the init was skipped and build-commit-from failed with `opendir(objects)`. The check now looks for the repo's config file. Co-Authored-By: Claude Fable 5.1 --- .forgejo/workflows/ci.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.forgejo/workflows/ci.yaml b/.forgejo/workflows/ci.yaml index 4b51b76..bfe465b 100644 --- a/.forgejo/workflows/ci.yaml +++ b/.forgejo/workflows/ci.yaml @@ -134,7 +134,9 @@ jobs: FLATPAK_GPG_KEY_ID=$(cat /run/crafter-flatpak/key-id) # The live repo is the canonical copy; builds are promoted into it, # never built into it. - [ -d "$REPO_DIR" ] || ostree init --repo="$REPO_DIR" --mode=archive + # Keyed on the repo's config file, not the directory: the web root + # may exist as an empty directory before the first publish. + [ -f "$REPO_DIR/config" ] || ostree init --repo="$REPO_DIR" --mode=archive flatpak build-commit-from --src-repo=repo \ --gpg-sign="$FLATPAK_GPG_KEY_ID" --gpg-homedir="$GNUPGHOME" \ "$REPO_DIR" "app/$APP_ID/x86_64/${{ steps.meta.outputs.branch }}"