Steps
- Log in into GitHub.
- Go to https://github.com/settings/tokens.
- Click on the Generate new token button on the top-right side of the screen and select Generate new token(classic)
4. Configure your token; add a note so you can identify it, add an expiration period.
5. Add the proper scopes (repo, write:packages, write:org) and click generate token.
6. After that, you will be able to copy your token keep it somewhere safe.
Aaand you're all set!