-
-
Notifications
You must be signed in to change notification settings - Fork 0
Personal Access Token (PAT)
GitHub Star Tracker requires a Personal Access Token rather than the default GITHUB_TOKEN. This page explains why and walks through creating one.
The GITHUB_TOKEN provided automatically by GitHub Actions is scoped to the current repository only. GitHub Star Tracker needs to list all repositories owned by the authenticated user via GET /user/repos, which requires broader access. This is a GitHub API restriction — the automatic token simply cannot enumerate repos outside the triggering repository.
Simpler setup, proven reliability, optional expiration.
- Go to GitHub Settings > Developer settings > Personal access tokens > Tokens (classic)
- Click "Generate new token (classic)"
- Configure:
-
Note:
GitHub Star Tracker - Expiration: 90 days recommended (set a calendar reminder)
-
Scopes:
-
repo— for tracking private + public repositories - OR
public_repo— for public repositories only
-
-
Note:
- Click "Generate token"
-
Copy the token immediately — it starts with
ghp_and won't be shown again
- Go to your repository's Settings > Secrets and variables > Actions
- Click "New repository secret"
- Create:
-
Name:
GITHUB_STAR_TRACKER_TOKEN - Value: paste the token
-
Name:
- Click "Add secret"
- uses: fbuireu/github-star-tracker@v1
with:
github-token: ${{ secrets.GITHUB_STAR_TRACKER_TOKEN }}More granular control, required expiration, better for team environments.
- Go to GitHub Settings > Developer settings > Personal access tokens > Fine-grained tokens
- Click "Generate new token"
- Configure:
-
Token name:
GitHub Star Tracker -
Description:
Star tracking across repositories - Expiration: 90 days recommended
- Resource owner: your account
-
Repository access:
All repositories -
Permissions > Repository permissions:
-
Metadata: Read-only (minimum required)
-
-
Token name:
- Click "Generate token"
-
Copy the token immediately — it starts with
github_pat_
Same as Classic Token — see Step 2 above.
| Scope | Token Type | Access |
|---|---|---|
repo |
Classic | All repos (private + public) |
public_repo |
Classic | Public repos only |
Metadata: Read-only |
Fine-grained | Depends on repository access selection |
Minimum scope: if you only need to track public repositories,
public_repo(classic) is sufficient.
-
Minimum permissions: use
public_repoif you only track public repos - Set expiration: 90 days recommended; set a calendar reminder to rotate
- Store in GitHub Secrets only: never commit tokens to code
- Rotate regularly: revoke and regenerate periodically
- Monitor usage: check token activity at GitHub Settings > Tokens
| Error | Cause | Solution |
|---|---|---|
Bad credentials |
Token expired or revoked | Generate a new token and update the secret |
Resource not accessible by integration |
Using GITHUB_TOKEN instead of PAT |
Create a PAT with proper scope |
Not Found for private repos |
Token has public_repo but not repo scope |
Edit token to add repo scope |
Bad credentials after copy/paste |
Extra whitespace in secret value | Re-copy the token carefully, trim whitespace |
- Getting Started — Continue setup after creating your token
- Configuration — Customize tracking options