Creating a read-only token
You don’t need a token if every repo you track is public. Without one, GitHub allows 60 requests an hour per IP address, shared with anything else on your network. With everything turned on a repo costs up to 5 requests per check, so without a token the plugin checks less often (one repo about every 6 minutes, ten repos about every hour). Review request alerts always need a token. A token raises the limit to 5,000 an hour, makes unchanged responses free, and is required for private repos.
Know where the token is kept. Repo Watch stores it unencrypted in Stream Deck’s settings on your computer. Any program running under your user account can read it, and so can anyone who gets a copy of those settings, for example from a backup or a synced profile folder. So give the token as little power as possible: read-only, limited to the repos you track, and with an expiry date. If it leaks, it can then only read those repos, and only until it expires.
Use a fine-grained personal access token. It can be limited to read-only access, unlike a classic token.
- Open Settings → Developer settings → Personal access tokens → Fine-grained tokens and click Generate new token. Faster: the Create a read-only token on GitHub button in the plugin’s settings, or this link, opens the form with the name, a 90-day expiry and the four read-only permissions below already filled in. You still choose the owner and the repos.
- Token name: something you’ll recognize, for example
Stream Deck Repo Watch. - Expiration: pick a date. 90 days is a sensible default. Don’t choose “No expiration”: a token that never expires stays useful to whoever finds it. When it expires, tiles show
Token rejected (401)until you make a new one and paste it in. - Resource owner: your account, or the organization that owns the private repos you want to track. A token covers one owner. If an organization requires approval, the token can only read public repos until an admin approves it.
- Repository access:
- Public repos only: choose Public repositories (read-only). No permissions are needed.
- Private repos: choose Only select repositories and pick only the repos you track. Don’t choose All repositories, which also covers every repo the owner creates later. Then under Permissions → Repository permissions, set Contents, Issues, Pull requests and Actions to Read-only. GitHub adds Metadata: Read-only automatically. Leave everything else at No access, and never choose Read and write. (Issues, Pull requests and Actions are for the new issue, PR and failed-CI alerts. Leave them at No access if you turn those alerts off.)
- Click Generate token, copy it, paste it into the plugin’s Token field, and click Save.
Every token can read public repos, so a token made for your private repos also covers the public ones you track.
If your organization blocks fine-grained tokens. Some organizations don’t allow them, or never approve them. Then use a classic token, in this order of preference:
- The repos you need are public: a classic token with no scopes ticked. It can read public information and nothing else.
- Last resort, for private repos: a classic token with only the
reposcope. Be clear about what that means:repogrants read and write access to every private repo you can reach, in every organization, and it can’t be narrowed. Give it the shortest expiry you can live with, tick no other scope, and replace it with a fine-grained token as soon as your organization allows one. If the organization uses SAML single sign-on, also authorize the token for it (Configure SSO on the token’s page).
If you save a classic token with any scope that can change things (repo, public_repo, workflow, admin:…, write:…, delete_repo and so on), the settings panel shows a warning while it is saved. Repo Watch never needs any of them.
If a token leaks, or you stop using the plugin, delete it in your GitHub token settings. Removing it from the plugin doesn’t revoke it.
Sources: Managing your personal access tokens, permissions for List releases and List commits (Contents: read; no permission needed for public repos), List workflow runs (Actions: read), List repository issues, List pull requests, conditional requests and the rate limit, Scopes for OAuth apps.