movies-app/.gitapp/operations/update-record.yaml

23 lines
576 B
YAML

name: update-record
version: 1
scope:
subtree: "collections/"
input:
$schema: zod
schema: |
z.object({
collection: z.string().min(1),
id: z.string().min(1),
data: z.record(z.unknown())
})
preconditions:
- type: path_exists
path: "collections/${input.collection}/${input.id}.json"
mutations:
- type: create_file
path: "collections/${input.collection}/${input.id}.json"
content: "${JSON.stringify(input.data, null, 2)}"
commit:
message: "feat(data): update ${input.collection} record ${input.id}"
updateRef: "refs/heads/main"