From 262a3a72f4ac8004d67aee5764396c951199ccc8 Mon Sep 17 00:00:00 2001 From: Michel Roegl-Brunner Date: Wed, 11 Mar 2026 15:29:54 +0100 Subject: [PATCH] Test workflow --- .github/workflows/push_json_to_pocketbase.yml | 8 +++- frontend/public/json/test copy.json | 44 +++++++++++++++++++ 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 frontend/public/json/test copy.json diff --git a/.github/workflows/push_json_to_pocketbase.yml b/.github/workflows/push_json_to_pocketbase.yml index 076d6232d..8516f302c 100644 --- a/.github/workflows/push_json_to_pocketbase.yml +++ b/.github/workflows/push_json_to_pocketbase.yml @@ -258,12 +258,18 @@ jobs: var scriptId = JSON.parse(r.body).id; var resolved = await resolveNotesAndInstallMethods(scriptId); console.log('Created', resolved.noteIds.length, 'notes,', resolved.installMethodIds.length, 'install_methods for slug=' + data.slug); + var patchPayload = {}; + for (var k in payload) patchPayload[k] = payload[k]; + patchPayload.notes = resolved.noteIds; + patchPayload.install_methods = resolved.installMethodIds; var patchRes = await request(recordsUrl + '/' + scriptId, { method: 'PATCH', headers: { 'Authorization': token, 'Content-Type': 'application/json' }, - body: JSON.stringify({ install_methods: resolved.installMethodIds, notes: resolved.noteIds }) + body: JSON.stringify(patchPayload) }); if (!patchRes.ok) throw new Error('PATCH relations failed: ' + patchRes.body); + var patched = JSON.parse(patchRes.body); + console.log('Script linked: notes=' + (patched.notes && patched.notes.length) + ', install_methods=' + (patched.install_methods && patched.install_methods.length)); } } console.log('Done.'); diff --git a/frontend/public/json/test copy.json b/frontend/public/json/test copy.json new file mode 100644 index 000000000..9b0d1fc35 --- /dev/null +++ b/frontend/public/json/test copy.json @@ -0,0 +1,44 @@ +{ + "name": "TEST2", + "slug": "test2", + "categories": [ + 12 + ], + "date_created": "2026-01-18", + "type": "ct", + "updateable": true, + "privileged": false, + "interface_port": 3010, + "documentation": "https://affine.pro/docs", + "website": "https://affine.pro/", + "logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/affine.webp", + "config_path": "/opt/affine/.env", + "description": "Open-source, privacy-first workspa ce for notes, docs, and knowledge management with offline-first design and end-to-end encryption.", + "install_methods": [ + { + "type": "default", + "script": "ct/affine.sh", + "resources": { + "cpu": 4, + "ram": 12288, + "hdd": 20, + "os": "Debian", + "version": "13" + } + } + ], + "default_credentials": { + "username": null, + "password": null + }, + "notes": [ + { + "text": "Initial build takes 20-30 minutes due to native module compilation.", + "type": "info" + }, + { + "text": "Requires at least 8GB RAM for building and 4GB for runtime.", + "type": "warning" + } + ] +}