Private repository data
Counting work that is not public, with a token scoped to just that.
Private Repository Data#
Use a dedicated personal access token when your dashboard should include private repositories. Do not rely on the default GITHUB_TOKEN for this purpose: it is scoped to the workflow repository and cannot read every private repository owned by the profile user.
Create one of these tokens:
- Classic PAT: use this template, then create the token with
reposelected: <https://github.com/settings/tokens/new?description=GitHub%20Personal%20Stats&scopes=repo> - Fine-grained PAT: use <https://github.com/settings/personal-access-tokens/new>, select the repositories you want counted, and grant read access to metadata and contents.
Save the token in your profile repository as an Actions secret:
gh secret set PERSONAL_STATS_TOKEN --repo your-login/your-login
The workflow should pass only that secret to the Action:
token: ${{ secrets.PERSONAL_STATS_TOKEN }}
Add a check step before generation so a missing token fails the workflow instead of silently generating public-only data:
- name: Check personal stats token
env:
PERSONAL_STATS_TOKEN: ${{ secrets.PERSONAL_STATS_TOKEN }}
run: test -n "$PERSONAL_STATS_TOKEN"
Private token access affects repository language share, contribution totals, streaks, and any stats based on private repository metadata. If the token is missing or under-scoped, the dashboard can still render, but the data will be public-only or incomplete.