From 848491e5aaeea461e9a1ec6770fde67bcd8f911f Mon Sep 17 00:00:00 2001 From: Levi van Noort <73097785+levivannoort@users.noreply.github.com> Date: Thu, 11 Jun 2026 13:45:27 +0200 Subject: [PATCH 1/2] chore: extract branch from download of examples --- scripts/download-content.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/download-content.ts b/scripts/download-content.ts index d142da9..95f7fc9 100644 --- a/scripts/download-content.ts +++ b/scripts/download-content.ts @@ -27,9 +27,12 @@ export async function downloadExamples() { const owner = "appwrite"; const repo = "appwrite"; const docsSubdirPath = `docs/examples/${appwriteExamplesBranch}`; + // The version-pinned example folders (docs/examples/) only live on the + // `main` branch; they were removed from the per-version branches like 1.8.x. + const ref = "main"; console.log(`Downloading examples from ${owner}/${repo}/${docsSubdirPath} to ${examplesTargetDir}`); - const downloadResult = await downloadTemplate(`gh:${owner}/${repo}/${docsSubdirPath}#${appwriteExamplesBranch}`, { + const downloadResult = await downloadTemplate(`gh:${owner}/${repo}/${docsSubdirPath}#${ref}`, { dir: examplesTargetDir, forceClean: true, }); From 2b3a3fc96ee445b6539e45906b4792a923efe834 Mon Sep 17 00:00:00 2001 From: Levi van Noort <73097785+levivannoort@users.noreply.github.com> Date: Thu, 11 Jun 2026 14:20:07 +0200 Subject: [PATCH 2/2] ci: validate build and content download on PRs to main Add a CI workflow that runs on pull_request to main, mirroring the Dockerfile's setup (bun install, patch-package) and running bun run build + bun run download-content. This catches build and download-content regressions before merge instead of only at the staging Docker build. init-vector-store is skipped to avoid OpenAI cost on every PR. Also relabel the examples download log from 'branch' to 'version', since the value is now the version subdirectory and the git ref is always main. Co-Authored-By: Claude Opus 4.8 --- .github/workflows/ci.yml | 28 ++++++++++++++++++++++++++++ scripts/download-content.ts | 2 +- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..8e1123d --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,28 @@ +name: CI + +on: + pull_request: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout the repo + uses: actions/checkout@v6 + + - name: Install Bun + uses: oven-sh/setup-bun@v2 + + - name: Install dependencies + run: bun install --frozen-lockfile + + - name: Apply patches + run: npx patch-package + + - name: Build + run: bun run build + + - name: Download content + run: bun run download-content diff --git a/scripts/download-content.ts b/scripts/download-content.ts index 95f7fc9..a259fcf 100644 --- a/scripts/download-content.ts +++ b/scripts/download-content.ts @@ -22,7 +22,7 @@ export async function downloadDocs() { } export async function downloadExamples() { - console.log(`Downloading examples from appwrite/appwrite (branch: ${appwriteExamplesBranch})`); + console.log(`Downloading examples from appwrite/appwrite (version: ${appwriteExamplesBranch})`); const owner = "appwrite"; const repo = "appwrite";