Skip to main content
Knowledge Base

How do I ensure a GitHub Personal Acccess token (PAT) is valid?

Answer

A customer asked: > How can I ensure a given GitHub Personal Access Token (PAT) is still valid? --- <ins datetime="2023-01-23T20:34:21Z"> <p><a href="https://support.gruntwork.io/hc/requests/109822">Tracked in ticket #109822</a></p> </ins>

# Step 1. Install GitHub's official `gh` command line tool [Official installation instructions](https://github.com/cli/cli#installation) # Step 2. Export the token to test as `GH_TOKEN` `export GH_TOKEN=<the-github-pat>` # Step 3. Run `gh auth status` `gh auth status` ![out](https://user-images.githubusercontent.com/1769996/214150704-2bbb6fc8-28b8-4447-9d72-5ecff797208d.gif)