This guide walks you through obtaining and configuring every secret and variable docNerd needs to run. All secrets are configured in your source repository (the repo where PRs are opened and where you comment @docNerd, doc for <branch>).
| Secret / Variable | Required | Where to get it |
|---|---|---|
DOCNERD_TARGET_OWNER |
Yes | Your docs repo owner (org or username) |
DOCNERD_TARGET_NAME |
Yes | Your docs repo name |
GITHUB_TOKEN |
Yes | Auto-provided by GitHub (no setup) |
DOCNERD_TARGET_REPO_TOKEN |
Yes | Create a Personal Access Token (PAT) with write access to docs repo |
ANTHROPIC_API_KEY |
Yes | Create at console.anthropic.com |
Important: GITHUB_TOKEN only has access to the repo where the workflow runs (your source repo). It cannot create branches or PRs in a different repo (your docs repo). You must create DOCNERD_TARGET_REPO_TOKEN for docNerd to write to the docs repo.
Before creating secrets, you need two values from your MkDocs + Mike documentation repository:
- Owner — The GitHub organization or username that owns the docs repo
- Example:
beamable(org) orjohndoe(user)
- Example:
- Repository name — The repo name (without the owner)
- Example:
beamable-docsormy-docs
- Example:
How to find these:
- Open your docs repo in a browser:
https://github.com/beamable/beamable-docs - Owner =
beamable, Name =beamable-docs
- Go to your source repository (where PRs are opened).
- Click Settings → Secrets and variables → Actions.
- Click New repository secret for each secret below.
- Value: The owner of your docs repo (org or username).
- Example:
beamable - How to get it: Look at the URL of your docs repo:
github.com/{owner}/{repo}.
- Value: The name of your docs repo (no
.git, no URL). - Example:
beamable-docs - How to get it: Same URL — the part after the owner.
- Value: You do not create this. GitHub automatically provides it to every workflow run.
- How to use it: In your workflow, pass
${{ secrets.GITHUB_TOKEN }}to the action. It is always available; no setup required. - Permissions: The default
GITHUB_TOKENhas access to the repo where the workflow runs. If your source and docs repos are in the same org and the workflow runs in the source repo, this token can typically read the source repo and write to the docs repo (if the docs repo is in the same org and the token has sufficient scope).
docNerd uses Claude to generate documentation. You need an API key from Anthropic.
- Go to console.anthropic.com.
- Sign in or create an account.
- Navigate to API Keys (or Settings → API Keys).
- Click Create Key.
- Give it a name (e.g.
docNerd). - Copy the key immediately — it is shown only once.
- In your source repo: Settings → Secrets and variables → Actions.
- Click New repository secret.
- Name:
ANTHROPIC_API_KEY - Value: Paste the key you copied.
- Anthropic charges per token. Check anthropic.com/pricing for current rates.
- Set usage limits in the Anthropic console if desired.
- Keep the key private; never commit it to a repo.
DOCNERD_TARGET_REPO_TOKEN is required. The default GITHUB_TOKEN only has access to the repo where the workflow runs (your source repo). It cannot create branches or PRs in your docs repo, which is a different repository.
- On GitHub, click your profile picture → Settings.
- In the left sidebar, scroll to Developer settings → Personal access tokens.
- Choose Tokens (classic) or Fine-grained tokens.
- Click Generate new token (classic).
- Name:
docNerd docs repo. - Expiration: choose a duration (e.g. 90 days or No expiration).
- Scopes: enable
repo(full control of private repositories). - Click Generate token.
- Copy the token — it is shown only once.
- Click Generate new token.
- Name:
docNerd docs repo. - Expiration: choose a duration.
- Repository access: Select Only select repositories and choose your docs repo.
- Permissions:
- Contents: Read and write
- Metadata: Read-only
- Pull requests: Read and write
- Click Generate token.
- Copy the token.
- In your source repo: Settings → Secrets and variables → Actions.
- Click New repository secret.
- Name:
DOCNERD_TARGET_REPO_TOKEN - Value: Paste the token.
For org-wide use:
- Go to your org: Settings → Secrets and variables → Actions.
- Add the same secrets there.
- Choose which repos can use them (e.g. all repos or a selected list).
All comments include "I am docNerd." at the start, so you can identify them without a separate bot account.
By default, comments are posted by github-actions. To have them appear under a docNerd account instead:
- Create a GitHub account named
docNerd(ordocNerd-botif taken). - Add it as a collaborator to both your source repo and docs repo (Write or Admin).
- Create a PAT for that account (Settings → Developer settings → Personal access tokens) with
reposcope. - Add secret
DOCNERD_BOT_TOKENin your source repo with that PAT. - Pass it to the action:
bot-token: ${{ secrets.DOCNERD_BOT_TOKEN }}
Tip: You can use the same docNerd account PAT for both bot-token and target-repo-token if the account has access to both repos.
Your workflow should pass the secrets to the action:
- uses: beamable/docnerd@v1
with:
target-owner: ${{ secrets.DOCNERD_TARGET_OWNER }}
target-name: ${{ secrets.DOCNERD_TARGET_NAME }}
github-token: ${{ secrets.GITHUB_TOKEN }}
target-repo-token: ${{ secrets.DOCNERD_TARGET_REPO_TOKEN }}
anthropic-api-key: ${{ secrets.ANTHROPIC_API_KEY }}
bot-token: ${{ secrets.DOCNERD_BOT_TOKEN }} # Optional: comments appear as docNerdNotes:
bot-tokenis optional. When omitted, comments appear as github-actions.- If you did not create
DOCNERD_TARGET_REPO_TOKEN, you can either:- Omit the
target-repo-tokeninput, or - Pass an empty string:
target-repo-token: ''
- Omit the
- The action will fall back to
GITHUB_TOKENwhentarget-repo-tokenis empty.
- Cause:
GITHUB_TOKENonly has access to the source repo. It cannot write to the docs repo. - Fix: Create
DOCNERD_TARGET_REPO_TOKEN(a PAT with write access to the docs repo) and pass it to the action:- uses: beamable/docnerd@v1 with: target-owner: ${{ secrets.DOCNERD_TARGET_OWNER }} target-name: ${{ secrets.DOCNERD_TARGET_NAME }} github-token: ${{ secrets.GITHUB_TOKEN }} target-repo-token: ${{ secrets.DOCNERD_TARGET_REPO_TOKEN }} # Required! anthropic-api-key: ${{ secrets.ANTHROPIC_API_KEY }}
- The requested branch does not exist in the docs repo.
- Fix: Ensure the branch (e.g.
core/v7.1) exists in the docs repo before commenting.
ANTHROPIC_API_KEYis missing or not passed correctly.- Fix: Add the secret and ensure it is passed as
anthropic-api-keyin the workflow.
DOCNERD_TARGET_OWNERorDOCNERD_TARGET_NAMEis missing or wrong.- Fix: Add both secrets and double-check spelling and casing.
- The comment may not match the trigger.
- Fix: Use exactly
@docNerd, doc for <branch>(e.g.@docNerd, doc for core/v7.1).
- Never commit secrets — Use GitHub Secrets only.
- Rotate keys periodically — Especially PATs and API keys.
- Use fine-grained tokens when possible — Limit scope to the docs repo.
- Review org access — If using org secrets, restrict which repos can use them.
- Monitor usage — Check Anthropic usage and set limits if needed.