Skip to content

Github Setup For Open Source Projects

Naveen M K edited this page Mar 22, 2021 · 8 revisions

How to create a Personal Token?

Generate a Github personal access token using these instructions. Make sure you don't select any scope just generate a simple token

What is that token and why do I need it?

Tokens are used to access the Github API, and is used to get your contents from Github, about your profile and also your Pinned Repositories. See the sections Github Profile and Open Source sections.

Open Source Section profile-section

Steps to Set Personal Access Token

On Windows (Using Command Prompt(aka cmd) or Powershell)

  1. Open a command prompt windows(⊞ Win+R; type cmd and enter)

  2. Type the below command replacing <GitHub personal access token> with your Access token which you got from Github.

     setx REACT_APP_GITHUB_TOKEN "<GitHub personal access token>"

    What this command does is it creates an environment variable REACT_APP_GITHUB_TOKEN with your Github Access tokens. This will be permanent and can be used in all future build.

  3. Then create another environment variable GITHUB_USERNAME to point to your Github username.

     setx GITHUB_USERNAME "<Your Github Username>"
  4. Finally, follow the other steps in ReadMe and then deploy it to Github or create production pages.

On Mac/Linux

  1. Open a Terminal(Alt+Ctrl+T).

  2. Type the below command replacing <GitHub personal access token> with your Access token which you got from Github.

    export REACT_APP_GITHUB_TOKEN="<GitHub personal access token>"

    This command sets the environment variable REACT_APP_GITHUB_TOKEN which is used while building the site.

  3. Then create another environment variable GITHUB_USERNAME to point to your Github username.

     export GITHUB_USERNAME="<GitHub username>"
  4. Finally, follow the other steps in ReadMe and then deploy it to Github or create production pages.

Set showGithubProfile to true or false to show Contact Profile using Github, defaults to false. Note: Open Source Projects section only show pinned items of your Github. If you are seeing

empty-profile

Please follow these instructions to select which repositories to pin on your profile.