Guide

GitHub Action inputs and outputs

DocsPress is a Node 20 GitHub Action configured entirely through with inputs.

Synchronization mode

InputDefaultDescription
modepublishpublish sends Markdown to WordPress, propose opens a Markdown pull request from WordPress edits, and reconcile safely handles both directions.

WordPress connection

InputDefaultDescription
wordpress-urlhttps://public-api.wordpress.comAPI base. For self-hosted WordPress, use the site origin without /wp-json.
wordpress-siterequiredWordPress.com site ID or domain. Action metadata requires it for every run.
wordpress-access-tokenrequiredBearer token permitted to edit Pages. Use the WP_ACCESS_TOKEN GitHub Actions secret.

Documentation discovery and routing

InputDefaultDescription
docs-dirdocsDirectory containing .md and .markdown files.
manifest-fileemptyOptional JSON manifest for explicit titles, slugs, parents, and source files.
sidebars-fileemptyOptional YAML or JSON route map for advanced contextual sidebars in the DocsPress theme. Without it, DocsPress keeps one automatic Page tree.
redirects-fileemptyOptional JSON redirects map that creates managed moved-page placeholders.
versions-fileemptyOptional ordered API-version registry. Enables root, directory, suffix, and per-version manifest sources through DocsPress Blocks.
root-slugdocsSlug of the managed root Page.
root-titleDocsFallback root title when no root document supplies one.
InputDefaultDescription
create-h1falseAdds the Page title as an H1 Gutenberg block. Keep false with the DocsPress theme.
rewrite-linkstrueRewrites known local Markdown targets to their WordPress routes.
edit-linkfalseAppends a source link to Markdown-backed Pages.
edit-link-textEdit this page on GitHubText for the appended source link.
github-repositoryGITHUB_REPOSITORYRepository used in edit URLs, for example owner/repo.
github-refGITHUB_REF_NAME, then mainBranch or ref used in edit URLs.
github-server-urlGITHUB_SERVER_URL, then https://github.comGitHub server used in edit URLs.

WordPress-to-GitHub pull requests

InputDefaultDescription
github-tokengithub.tokenToken used to create commits, the managed branch, and pull requests.
pull-request-baserepository default branchBase branch for the rolling pull request.
pull-request-branchdocspress/wordpress-syncAction-owned branch that is refreshed from the latest base on every run.
pull-request-titlegeneratedOptional pull request and commit title override. The generated title follows Conventional Commits, for example docs(sync-and-rest-api): sync changes from WordPress.

Reverse sync requires contents: write and pull-requests: write. The repository must also allow GitHub Actions to create pull requests, or github-token must use a suitable GitHub App or personal access token. Follow the continuous synchronization guide to enable the repository setting.

Publication and deletion

InputDefaultDescription
statuspublishWordPress status for created or updated Pages. Start with draft.
delete-modetrashtrash moves removed managed Pages to Trash; force permanently deletes them.
dry-runfalsePlans operations without WordPress or GitHub writes. Start with true.

Outputs

OutputDescription
createdPages created or planned for creation.
updatedPages updated or planned for update.
deletedPages deleted or planned for deletion.
unchangedManaged Pages already matching the desired state.
conflictsUnmanaged Page collisions, unsupported WordPress structure changes, or edits made on both sides.
proposedRepository files proposed from WordPress.
skippedWhether the Action skipped a managed reverse-sync merge push.
pull-request-numberRolling reverse-sync pull request number, when present.
pull-request-urlRolling reverse-sync pull request URL, when present.
summary-jsonJSON object containing counters, conflict details, and ordered operations.

The Action also writes a GitHub Actions job summary and fails the run when conflicts is greater than zero.

Was this helpful?