To track every fine-grained token in your GitHub organisation, use the GitHub App instead. GitHub has no API that lists a user’s own tokens.
How it works
Once a day (08:30 UTC) Expira callsGET /user with the token and reads GitHub’s github-authentication-token-expiration response header. The asset is named “GitHub Token —” followed by the connection’s display name.
If the token has no expiry date, GitHub sends no header and Expira creates no asset. Fine-grained tokens always have one; classic tokens only if you set one.
Connect a token
1
Pick the token
Use the token whose expiry you want to track. It needs no extra permissions:
GET /user works with any valid token.2
Add the connection in Expira
Go to Integrations → GitHub → Add connection and fill in:
- Display name, for example “CI deploy token”.
- GitHub URL:
https://github.com, or your GitHub Enterprise Server address such ashttps://github.example.com. - Personal Access Token (starts with
github_pat_for fine-grained tokens).
3
Sync
Press Sync. The token appears under Assets with its expiry date.
GitHub Enterprise Server
The URL must usehttps and be reachable from the public internet, because Expira calls it from the cloud. A server that only resolves on a VPN or a private network can’t be reached. See Troubleshooting.