1
0
mirror of synced 2025-12-22 11:26:57 -05:00
Files
docs/lib/github.js
Vanessa Yuen 3df90fc9b8 Hello git history spelunker!
Are you looking for something? Here is all of the GitHub Docs history in one single commit. Enjoy! 🎉
2020-09-27 14:10:11 +02:00

19 lines
563 B
JavaScript

if (!process.env.GITHUB_TOKEN) {
require('dotenv').config()
}
// this module needs to work in development, production, and GitHub Actions
//
// GITHUB_TOKEN comes from one of the following sources:
// 1. set in the .env file (development)
// 2. set as a Heroku config var (staging and production)
// 3. an installation token granted via GitHub Actions
const apiToken = process.env.GITHUB_TOKEN
// See https://github.com/octokit/rest.js/issues/1207
module.exports = function github () {
return require('@octokit/rest')({
auth: `token ${apiToken}`
})
}