How to use the authenticate function from @octokit/rest
Find comprehensive JavaScript @octokit/rest.authenticate code examples handpicked from public code repositorys.
0 1 2 3 4 5 6 7 8
const parse = require('parse-github-url'); const octokit = require('@octokit/rest')(); const {execSync} = require('child_process'); module.exports = async function ({change, branch}) { octokit.authenticate({ type: 'token', token: process.env.GITHUB_TOKEN });
7
16
77
16 17 18 19 20 21 22 23 24 25
const generateViewState = (configuration) => { showIssues = configuration.showIssues.value === 'true' showPRs = configuration.showPRs.value === 'true' show_details_threshold = parseInt(configuration.showDetailsThreshold.value, 10) octokit.authenticate({type: 'oauth', token: configuration.token.value}) return paginate(octokit.repos.getForOrg) .then(data => Promise.all(data.map(queryRepoIssues))) .then(repos => repos.filter(each => each.prs.length > 0 || each.issues.length > 0)) // remove repositories with no open prs or issues
2
0
2
1 2 3 4 5 6 7 8 9 10
debug: true }) class GithubApiFunctions { constructor (token) { octokit.authenticate({ type: 'oauth', token: token }) } async userProfile() { try {
0
1
4
@octokit/rest.Octokit is the most popular function in @octokit/rest (61 examples)