Q:

How do I set an environment variable for GitHub repositorys? 

So I'm creating a website in a GitHub repo, on which I'm trying to implement a Discord Login via OAuth2.  For all that to work I need to set an environment variable for the client id and secret.  How do I set an environment variable in a GitHub repo? 

A:

How do I set an env var in a github repo

Env vars are only relevant to the machine actually running the bot (or website). 
Most hosting companies today give you a way to edit your environment variables.  If you are using github as a webhost, maybe see this github article. 
Let's say you have a string which needs to be in a variable token.  For your local development, you create a file that simply sets that variable.  Make sure to exclude it from git by including it in your .gitignore!  
And in your code, you only use that file IF the env var isn't set.  e.g.:
// load auth & other tokens
var token = null;
if (process.env.hasOwnProperty('TOKEN')) {
  token = process.env. TOKEN;
}
else {
  var auth = require('./discordauth.json');
  token = auth.token;
}

From there you just have to learn how to set env vars in your particular hosting.  Create an env var named TOKEN (to match process.env. TOKEN in the code example).  Example:
Contents of file discordauth.json:
{
"token": "XXXXXXXXXXXXX",
}

Value of env var TOKEN
XXXXXXXXXXXXX

