Doc Sync
Doc Sync is a GitHub Action that uploads markdown and text files from your repo into workspace knowledge. Unchanged files are skipped by checksum. Changed files replace the previous document with the same filename and labels. Use it when product specs, runbooks, or FAQs already live in git and you want agents to retrieve them without a manual upload step.The mental model
How a run works
- Collect files from
paths(files, directories, or globs) relative torepo_dir. - List existing knowledge in the workspace and keep documents whose labels match
tags. - For each local file, compare checksums against a remote document with the same filename.
- Skip when the checksum already matches. Replace when it changed (delete the old document, then upload). Upload when the file is new.
.md, .mdx, .markdown, and .txt. Hidden directories, node_modules, and vendor are ignored. The document title is derived from the path (extension stripped; - and _ become spaces). The stored filename is the path relative to repo_dir.
Matching is scoped by filename and labels. The same path with different tags is a different document. Only documents that carry exactly the tags you pass are skipped, replaced, or cleaned up.
Set up the GitHub Action
1
Create an access key
In Settings → Access keys, create a key with knowledge permissions to list, upload, and delete documents.Copy the workspace id and the key secret (shown once). Use a dedicated key for this integration.
2
Add repository secrets
In the GitHub repo, add:
3
Add a workflow
Copy this into
.github/workflows/sync-docs.yml, or start from Actx0/doc-sync-example.Pull requests run in dry-run mode. Pushes to main upload and replace documents.Inputs
paths examples:
tags become knowledge labels (key=value). Prefer a tag label so document search can filter the corpus:
Outputs
The step also writes a job summary table. If any file fails, the action exits non-zero.
dry_run: "true" to print skip / upload / replace actions without changing knowledge.
Run from a terminal
Use the CLI when you are not on GitHub Actions — from your machine or another CI system.--path is repeatable. --dry-run compares checksums without uploading. Flags match the action inputs above.
Next steps
Knowledge
How documents are chunked, indexed, and searched
Example repo
Sample docs and a workflow
Upload Document
Multipart upload, labels, and limits
Search Documents
Semantic retrieval over indexed chunks
