Skip to main content

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

  1. Collect files from paths (files, directories, or globs) relative to repo_dir.
  2. List existing knowledge in the workspace and keep documents whose labels match tags.
  3. For each local file, compare checksums against a remote document with the same filename.
  4. Skip when the checksum already matches. Replace when it changed (delete the old document, then upload). Upload when the file is new.
Directories include .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.
Keep access keys in GitHub secrets. Do not commit them to the workflow file.

Inputs

paths examples:
A directory walk only picks markdown and text files. A glob or explicit file can select any matching path. A glob that matches nothing fails the step. 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.
Set 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