Skip to content

The token

Everything here is read access. The collector never writes to GitHub. What varies is how much of the account a given token is allowed to see, and a handful of scopes are worth understanding rather than just granting.

  1. Go to https://github.com/settings/tokens.

  2. Choose the kind of token and give it the scopes below.

    repo, read:packages, read:user, read:org, security_events, read:public_key and read:gpg_key covers everything this collects.

  3. Put it where the process can read it, and nowhere else.

    Terminal window
    export GITHUB_TOKEN=github_pat_...

    The configuration file refers to it as ${GITHUB_TOKEN}, which is expanded from the environment at start-up. That is what lets the file be committed while the token stays out of it.

ScopeWithout it
Push access to the repositoryTraffic is a 403. GitHub only shows views and clones to someone who could push
security_eventsDependabot and code scanning alerts look exactly like a repository with the feature switched off
read:packagesThe container registry is invisible. Package versions cost one call per package
read:userFollowers, contributions, gists and social accounts are missing
read:orgRepositories owned by an organisation are not discovered
read:public_key, read:gpg_keyThe keys family writes nothing, and says nothing. No other scope implies either

Traffic is the one that surprises people. It is not a read scope at all: GitHub decides who may see views and clones by asking whether the caller could push, so a read-only token gets a 403 for every repository. The collector records that as “unavailable” and moves on, which is why the symptom is an empty traffic panel rather than a failed sweep.

Why the automatic GITHUB_TOKEN is not enough

Section titled “Why the automatic GITHUB_TOKEN is not enough”

A workflow gets a GITHUB_TOKEN for free. It is not enough for this, and the reason is worth being specific about rather than letting someone discover it as an empty dashboard.

  • It is scoped to one repository. Traffic needs push access to every repository being collected. The automatic token has it for the repository the workflow is running in, and nothing else.
  • It has no security_events. Dependabot and code scanning alerts are invisible to it.
  • It has no read:packages. The container registry is invisible to it.
  • It is not a user. Everything account-wide (followers, the contribution calendar, billing, notifications, the stars you gave) is about the person, not about a repository, and the automatic token is an installation, not a person.

So a workflow needs a personal access token stored as a repository secret and passed in as the token input. See GitHub Actions.

Possible, and honest about what it costs. A card of public numbers can be drawn from unauthenticated calls, but the traffic and alert panels will be empty and the log will say not available (403) for each of them. That is the collector reporting a permission, not a failure.