Skip to main content
GitHub Star Tracker requires a Personal Access Token (PAT) with appropriate permissions to access your repository data. The default GITHUB_TOKEN provided by GitHub Actions does not work because it lacks permissions to read repository lists across your account.

Why You Need a PAT

The default GITHUB_TOKEN has the following limitations:
  • Limited to the current repository only
  • Cannot list all repositories in your account
  • Restricted permissions scope
A Personal Access Token allows Star Tracker to:
  • Query all repositories in your account
  • Read star counts and metadata
  • Access both public and private repositories (based on scope)

Creating a Classic Token

Classic tokens are the recommended option for GitHub Star Tracker due to their straightforward setup.
2

Generate New Token

Click Generate new token > Generate new token (classic)
3

Configure Token

  • Note: Enter a descriptive name like GitHub Star Tracker
  • Expiration: Choose your preferred expiration period (90 days, 1 year, or no expiration)
  • Scopes: Select the appropriate scope:
    • repo - Full control of private repositories (required if tracking private repos)
    • public_repo - Access public repositories only (sufficient if tracking only public repos)
4

Generate and Copy

Click Generate token and copy the token immediately. You won’t be able to see it again.
Store your token securely. Never commit it to your repository or share it publicly.

Creating a Fine-Grained Token

Fine-grained tokens offer more granular permissions but require additional configuration.
2

Generate New Token

Click Generate new token
3

Configure Basic Settings

  • Token name: Enter a descriptive name like GitHub Star Tracker
  • Expiration: Choose your preferred expiration period
  • Resource owner: Select your personal account or organization
  • Repository access: Choose:
    • All repositories - Track all repos in your account
    • Only select repositories - Track specific repos only
4

Set Permissions

Under Permissions > Repository permissions, set:
  • Metadata: Read-only (automatically selected)
  • Contents: Read-only (for reading repository data)
5

Generate and Copy

Click Generate token and copy the token immediately.

Adding Token to Repository

Once you have your token, add it as a repository secret:
1

Navigate to Repository Settings

Go to your repository on GitHub > Settings > Secrets and variables > Actions
2

Create New Secret

Click New repository secret
3

Configure Secret

  • Name: GITHUB_STAR_TRACKER_TOKEN (or your preferred name)
  • Value: Paste your Personal Access Token
4

Save Secret

Click Add secret

Using the Token in Workflows

Reference your token in the workflow file using secrets:
- uses: fbuireu/github-star-tracker@v1
  with:
    github-token: ${{ secrets.GITHUB_STAR_TRACKER_TOKEN }}
The secret name in your workflow must match the name you created in repository settings.

Token Scope Comparison

Featurepublic_reporepo (Full)
Public repositories
Private repositories
Organization reposLimited
Archived repos
Forked repos

Security Best Practices

Choose public_repo scope if you only track public repositories. Only use repo when tracking private repositories.
Use token expiration to reduce security risks. Set calendar reminders to regenerate tokens before they expire.
Even with no expiration, rotate tokens periodically (e.g., every 6 months) as a security best practice.
Check your token’s usage in GitHub Settings to ensure it’s only being used by expected workflows.
Always store tokens in repository secrets, never in workflow files or code.

Troubleshooting

”Bad credentials” Error

  • Verify the token is correctly copied without extra spaces
  • Ensure the token hasn’t expired
  • Check that the token has the required scopes

”Not Found” or “Resource not accessible”

  • Verify the token has repo or public_repo scope
  • For fine-grained tokens, ensure repository access is configured correctly
  • Check that the resource owner matches your account

Token Expired

  • Generate a new token following the steps above
  • Update the repository secret with the new token value
  • No workflow changes are needed

Build docs developers (and LLMs) love