FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
github-docs/src/workflows/github.ts at main · jlawrence/github-docs · GitHub
jlawrence
/
github-docs
Public
forked from
github/docs
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
github-docs
/
src
/
workflows
/
github.ts
Copy path
More file actions
More file actions
Latest commit
History
History
History
31 lines (26 loc) · 824 Bytes
Breadcrumbs
github-docs
/
src
/
workflows
/
github.ts
Copy path
File metadata and controls
31 lines (26 loc) · 824 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env node
import
dotenv
from
'dotenv'
import
{
Octokit
}
from
'@octokit/rest'
import
{
retry
}
from
'@octokit/plugin-retry'
if
(
!
process
.
env
.
GITHUB_TOKEN
)
{
dotenv
.
config
(
)
}
const
RetryingOctokit
=
Octokit
.
plugin
(
retry
)
// 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
export
default
function
github
(
)
{
return
new
Octokit
(
{
auth
:
`token
${
apiToken
}
`
,
}
)
}
export
function
retryingGithub
(
)
{
return
new
RetryingOctokit
(
{
auth
:
`token
${
apiToken
}
`
,
}
)
}
Back
|
FazBrowse Home
|
New Git URL