How to use the repos function from @octokit/rest
Find comprehensive JavaScript @octokit/rest.repos code examples handpicked from public code repositorys.
GitHub: mapbox/secret-shield
19 20 21 22 23 24 25 26 27 28
return reject(err); }); } return new Promise((resolve, reject) => { octokit.repos.getForOrg(options).then((response) => { repos = repos.concat(parseRepos(response)); getRemanding(response, resolve, reject); }).catch((err) => { return reject(err);
13
34
74
8 9 10 11 12 13 14 15 16 17
type: 'basic', username: 'YOUR_GITHUB_USERNAME_HERE', password: 'YOUR_GITHUB_PERSONAL_ACCESS_TOKEN_HERE', }) const opt = octokit.repos.listForOrg.endpoint.merge({ org: 'devsisters' }) for await (const res of octokit.paginate.iterator(opt)) { if (res.status !== 200) { process.exit(-1) }
2
31
5
+ 3 other calls in file
10 11 12 13 14 15 16 17
token: GITHUB_AUTH, }) module.exports = { pullRequest: octokit.pullRequests.create, release: octokit.repos.createRelease, merge: octokit.pullRequests.merge, }
1
12
137
+ 3 other calls in file
35 36 37 38 39 40 41 42 43 44
} } async paginate (orgName) { let response = await octokit.repos.getForOrg({ org: orgName, type: 'all', per_page:100 })
0
1
4
+ 3 other calls in file
15 16 17 18 19 20 21 22 23 24
async function execScript() { // Compare: https://developer.github.com/v3/repos/#list-organization-repositories let dt = new Date(); dt.setFullYear(dt.getFullYear() -1); console.info('This search will return just the repos updated after' + dt); paginate(() => octokit.repos.getForOrg({ org: 'aerogear', archived: false })).then(data => { // handle data
2
0
19
18 19 20 21 22 23 24 25 26 27
data = data.concat(response.data) } return data } paginate(() => octokit.repos.getForOrg({org: process.env.org})) .then(data => { fs.writeFileSync('/repos', JSON.stringify(data)); }).catch(err => { console.log(err.message);
1
0
5
GitHub: briancabbott/ChatNow
89 90 91 92 93 94 95 96 97 98
octokit.authenticate({ type: 'oauth', token: process.env.GH_TOKEN }); await octokit.repos.createRelease({ owner: 'ionic-team', repo: 'ionic', target_commitish: 'master', tag_name: tag,
0
1
1
+ 4 other calls in file
GitHub: Axosoft/rest.js
90 91 92 93 94 95 96 97 98 99
``` Multiple preview headers can be combined by separating them with commas ```js const {data: {topics, code_of_conduct}} = octokit.repos.get({ owner: 'octokit', repo: 'rest.js', headers: { accept: 'application/vnd.github.mercy-preview+json,application/vnd.github.scarlet-witch-preview+json'
0
0
8
+ 5 other calls in file
@octokit/rest.Octokit is the most popular function in @octokit/rest (61 examples)