Access Tokens
About 663 wordsAbout 2 min
2026-11-04
The dual-repo setup uses at most two GitHub personal access tokens (PATs). They operate in opposite directions and are not interchangeable.
| Token | Permission | Stored in | Purpose |
|---|---|---|---|
DISPATCH_TOKEN | Theme repo Contents: Read and write | Content repo | Notify the theme repo to trigger automated builds |
CONTENT_REPO_TOKEN | Content repo Contents: Read | Theme repo | Allow the theme repo to check out private content |
If you only use a platform Deploy Hook and never build using theme repo Actions, you only need the platform hook secret. See Deployment Hooks. However, if your content repo is private, you still need a token granting Contents: Read on the content repo, embedded into the platform environment variable CONTENT_REPO_URL (see Content Sources); otherwise the platform build machine cannot fetch the content repo.
Create a token
The following instructions walk through creating DISPATCH_TOKEN (which requires write access to the theme repo). For CONTENT_REPO_TOKEN, select your content repo in Step 5, and set permissions to Contents: Read in Step 6.
Open personal settings
Click your GitHub avatar in the top right corner and choose Settings.

Open developer settings
Scroll to the bottom of the left sidebar and click Developer settings.


Choose fine-grained tokens
Expand Personal access tokens and select Fine-grained tokens.

Create new token
Click Generate new token in the top right.

Name token and select repository
- Token name: enter
DISPATCH_TOKENfor straightforward tracking; - Expiration: select duration, recommended 90 days. When expired, generate a replacement and update the secret;
- Repository access: choose Only select repositories, then select your theme repo.

Because the dispatch event is delivered to the theme repo, you must choose the theme repo here rather than the content repo.
- Token name: enter
Set Contents permission
Expand Permissions -> Repository permissions, find Contents, and set it to Read and write.

Generate and copy token
Click Generate token and copy the resulting string immediately.

GitHub displays the token string only once. Save it to a password manager before leaving the page.
Store it in the repository
Where a token lives depends on your deployment strategy:
- Cross-repo CI builds: save the token in GitHub repository Actions secrets (the steps below);
- Deploy Hook with platform-side builds: the read-only token for a private content repo never passes through GitHub secrets — embed it directly into the platform environment variable
CONTENT_REPO_URL. See Content Sources.
Tokens must be saved in your GitHub repository Actions secrets rather than in project files:
- Open the target repository, navigate to Settings -> Secrets and variables -> Actions;
- Click the New repository secret button;

- Name it
DISPATCH_TOKENorCONTENT_REPO_TOKEN, and paste the token string; - Click Add secret to save.
Configuration details are covered in Cross-Repo CI.
Notes
- Adhere to the principle of least privilege:
DISPATCH_TOKENrequires access only to the theme repo;CONTENT_REPO_TOKENrequires access only to the content repo. - When both theme and content repositories are public,
CONTENT_REPO_TOKENcan be omitted. - Never commit tokens to
.env, workflow files, or READMEs. URLs containing tokens should only reside in platform environment variables or GitHub secrets. - When tokens expire or permissions change, generate a new token, update the secret, and trigger a test build to verify.
Copyright
Copyright Ownership:Dawn6666666
License under:Attribution 4.0 International (CC-BY-4.0)