Command line¶
actdocs sync \
--docs-dir-target docs \
--index-target README.md \
.github/actions/*/action.yml .github/workflows/*.yml
Targets are never discovered: the set is whatever you pass. The one exception is the index, which by nature lists the whole repository.
Flags¶
| Flag | Meaning |
|---|---|
--docs-dir-target DIR |
Also mirror each document to DIR/actions/<name>.md or DIR/workflows/<name>.md |
--workflow-docs beside\|docs-dir |
Where a workflow's document goes; beside (default) writes it next to the workflow, docs-dir writes it only under --docs-dir-target |
--index-target FILE |
Rebuild the repository index in FILE, listing every action and workflow rather than only the targets given |
--hooks-target FILE |
Rebuild the hooks table in FILE from the .pre-commit-hooks.yaml at the repository root |
--check |
Report whether anything would change, and write nothing |
--root DIR |
Repository root that generated paths resolve against |
--config FILE |
Read settings from this file instead of searching for one |
--repo-slug |
owner/repo stamped into usage snippets and into the link a mirrored document opens with (ACTDOCS_REPO_SLUG) |
--ref-sha |
Commit SHA stamped into usage snippets (ACTDOCS_REF_SHA) |
--ref-version |
Version stamped into usage snippets (ACTDOCS_REF_VERSION) |
--pin sha\|version |
How usage snippets pin the reference |
Exit codes¶
| Code | Meaning |
|---|---|
| 0 | Nothing to do, or files were rewritten successfully |
| 1 | --check found a difference, or a document is missing its markers |
| 2 | A file could not be read, parsed or written |
Rewriting a file is deliberately not an error: hook runners detect modified
files themselves, and conflating the two would make --check useless in CI.
Feeding a documentation site¶
--docs-dir-target writes into the same tree a static site generator reads.
Pointing it at the site's docs_dir means the published reference pages are
regenerated by the same commit that changes an action, rather than by someone
remembering to.