Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

github.js 596 B

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
  1. if (!process.env.GITHUB_TOKEN) {
  2. require('dotenv').config()
  3. }
  4. // this module needs to work in development, production, and GitHub Actions
  5. //
  6. // GITHUB_TOKEN comes from one of the following sources:
  7. // 1. set in the .env file (development)
  8. // 2. set as a Heroku config var (staging and production)
  9. // 3. an installation token granted via GitHub Actions
  10. const apiToken = process.env.GITHUB_TOKEN
  11. const { Octokit } = require('@octokit/rest')
  12. // See https://github.com/octokit/rest.js/issues/1207
  13. module.exports = function github () {
  14. return new Octokit({
  15. auth: `token ${apiToken}`
  16. })
  17. }
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...