A GitHub Action that syncs markdown files from your repository to an Outline knowledge base. The repository is the source of truth.
- Syncs markdown files to Outline documents
- Uses file paths as document titles (e.g.,
docs/setup.md) - Supports incremental sync (only changed files on PR) or full sync
- Deletes documents when source files are removed
- Handles rate limits with exponential backoff
- Works with self-hosted Outline instances
name: Sync Docs to Outline
on:
pull_request:
paths: ['**/*.md']
jobs:
sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Required for git diff
- uses: 10xdeca/outline-sync-action@main
with:
outline_api_key: ${{ secrets.OUTLINE_API_KEY }}
collection_id: ${{ secrets.OUTLINE_COLLECTION_ID }}name: Full Docs Sync
on:
push:
branches: [main]
paths: ['docs/**/*.md']
jobs:
sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: 10xdeca/outline-sync-action@main
with:
outline_api_key: ${{ secrets.OUTLINE_API_KEY }}
collection_id: ${{ secrets.OUTLINE_COLLECTION_ID }}
sync_mode: full
file_pattern: 'docs/**/*.md'- uses: 10xdeca/outline-sync-action@main
with:
outline_api_key: ${{ secrets.OUTLINE_API_KEY }}
collection_id: ${{ secrets.OUTLINE_COLLECTION_ID }}
outline_base_url: 'https://outline.yourcompany.com'| Input | Required | Default | Description |
|---|---|---|---|
outline_api_key |
Yes | - | API key for Outline authentication |
collection_id |
Yes | - | Target collection ID in Outline |
outline_base_url |
No | https://app.getoutline.com |
Base URL for self-hosted instances |
sync_mode |
No | changed |
changed (only changed files on PR) or full (all files) |
delete_removed |
No | true |
Delete documents from Outline when source files are deleted |
file_pattern |
No | **/*.md |
Glob pattern for files to sync |
exclude_pattern |
No | - | Comma-separated glob patterns to exclude (e.g. CLAUDE.md,**/CLAUDE.md) |
| Output | Description |
|---|---|
synced_count |
Number of documents created or updated |
deleted_count |
Number of documents deleted |
failed_count |
Number of operations that failed |
- Changed mode (default on PRs): Uses
git diffto detect added, modified, and deleted files - Full mode: Syncs all files matching the pattern
- Documents are identified by title (which matches the file path)
- Existing documents are updated; new files create new documents
- Deleted files result in deleted documents (when
delete_removedis true)
- Go to your Outline settings
- Navigate to API section
- Create a new API key
- Store it as a GitHub secret (e.g.,
OUTLINE_API_KEY)
- Open the collection in Outline
- The collection ID is in the URL:
https://app.getoutline.com/collection/<collection-id> - Store it as a GitHub secret (e.g.,
OUTLINE_COLLECTION_ID)
- Checkout depth: Use
fetch-depth: 0withactions/checkoutfor changed-file detection to work - Document titles: File paths are used as titles.
docs/setup.mdcreates a document titled "docs/setup.md" - Rate limits: The action handles Outline's rate limits with automatic retry and exponential backoff
- Partial failures: If some files fail to sync, the action continues with others and reports failures at the end
The action will:
- Retry failed requests up to 3 times with exponential backoff
- Continue processing remaining files after individual failures
- Exit with code 1 if any operations failed
- Report all errors in the action output
MIT