# Repository automation
The GitLab project is the canonical source repository. Its `dev` branch is mirrored to GitHub. Repository mirroring transfers Git refs and files; it does not publish `docs/wiki` into either hosting platform's separate Wiki repository.
## Release Kitchen dispatch
`.github/workflows/dispatch-kitchen.yml` runs when the mirrored `dev` branch reaches GitHub. It calls GitHub's workflow-dispatch endpoint for `kitchen-release.yml` with `ref=kitchen`. This targets one known workflow and branch instead of relying on an unverified generic `repository_dispatch` event.
The workflow uses the repository-scoped `GITHUB_TOKEN` with only `actions: write` and `contents: read`. No personal access token is required for dispatch.
After this workflow is active, remove the old GitLab webhook that posts directly to GitHub's repository-dispatch endpoint. Keeping both paths can create two Kitchen runs for one merge.
Before publishing to crates.io, Kitchen checks the exact package version in
the official sparse crate index. An existing version is skipped without
calling `cargo publish`; a new version is published using
`CARGO_REGISTRY_TOKEN` from the Kitchen environment.
## Wiki publication
`.github/workflows/publish-wikis.yml` copies the complete contents of `docs/wiki` to the GitHub and GitLab Wiki repositories whenever documentation changes on mirrored `dev`. `docs/wiki` remains the source of truth; edits made only through either Wiki web interface are overwritten by the next publication.
Two GitHub Actions secrets authorize the separate Wiki pushes:
| `GITHUB_WIKI_TOKEN` | Write access to the GitHub repository Wiki. |
| `GITLAB_WIKI_TOKEN` | `write_repository` access to the GitLab project Wiki. |
GitHub requires one initial Wiki page before its Wiki Git repository can be cloned. Create that page once through the GitHub Wiki interface; the next publication replaces it with `docs/wiki`. GitLab's empty Wiki repository does not require a placeholder page.
If either secret or the initial GitHub page is missing, the corresponding publication is skipped with an Actions warning. Kitchen dispatch remains independent from Wiki publication.
## Verification
After a merge reaches mirrored `dev`:
1. Confirm **Dispatch release kitchen** completed and created one Kitchen workflow run on `kitchen`.
2. Confirm **Publish project wikis** did not report a missing token or uninitialized Wiki warning.
3. Open both Wiki tabs and verify that `Home`, provider guides, architecture, security, and roadmap pages are present.
4. Confirm only one release workflow was created for the merged revision.