Hi, Learning & Development series is BACK !!! I hope we can study together more often.

What is token?

GitHub token or known as Personal access token is another way to authenticate GitHub other than using a password. We could use token when we try to hit GitHub API or send GitHub command via terminal.

Generate token

  • Input GitHub password.
  • Input Note as a token name.
  • Set Expiration date.
  • Choose token access in Select scopes section. We can ticked all the checkboxes or select specific scope.
  • Click Generate token button.
  • Please read carefully in section Make sure to copy your personal access token now. You won’t be able to see it again!, because we have to re-generate different token with same purpose if we lost the token.

Note: GitHub token always starts with ghp_.

Where to store the token?

I’ll using GitHub secret for this article.

  • Go to our repo link + /settings/secrets/actions.
  • Click New repository secret button.
  • Input Name for secret name.
  • Input token in Value field.
  • Click Add secret button.

Once secret key is created, we can only update the value without being able to see the previous key again.

  • Click Update button.
  • We can update to new token with empty previous token only.

--

--

Ferawati Hartanti Pratiwi

QA (Quality Ambassador) | mpermperpisang official Medium account