File tree Expand file tree Collapse file tree 5 files changed +347
-183
lines changed
GetAllRepositoriesForOrganization Expand file tree Collapse file tree 5 files changed +347
-183
lines changed Original file line number Diff line number Diff line change 1- const octokit = require ( '@octokit/rest' ) ( {
2- headers : {
3- 'user-agent' : 'FanOutFanInCrawler'
4- }
5- } )
6- octokit . authenticate ( {
7- type : 'token' ,
8- token : process . env [ 'GitHubToken' ]
9- } )
1+ const { Octokit } = require ( '@octokit/rest' ) ;
102
11- module . exports = async function ( context ) {
3+ const octokit = new Octokit ( {
4+ userAgent : 'FanOutFanInCrawler' ,
5+ auth : `token ${ process . env [ 'GitHubToken' ] } `
6+ } ) ;
7+
8+ module . exports = async function ( context ) {
129 // retrieves the organization name from the Orchestrator function
1310 var organizationName = context . bindings . input ;
1411
1512 var finalResult = [ ]
1613 let page = 1
1714 do {
1815 // invoke the API to retrieve the list of repositories of a specific organization
19- var result = await octokit . repos . getForOrg ( {
16+ var result = await octokit . repos . listForOrg ( {
2017 org : organizationName ,
2118 type : 'public' ,
2219 page : page
@@ -26,5 +23,5 @@ module.exports = async function(context) {
2623 finalResult = finalResult . concat ( result . data )
2724 } while ( result . data . length !== 0 )
2825
29- context . done ( null , finalResult ) ;
26+ context . done ( null , finalResult ) ;
3027}
Original file line number Diff line number Diff line change 11const df = require ( 'durable-functions' )
2- const octokit = require ( '@octokit/rest' ) ( {
3- headers : {
4- 'user-agent' : 'FanOutFanInCrawler'
5- }
6- } )
7- octokit . authenticate ( {
8- type : 'token' ,
9- token : process . env [ 'GitHubToken' ]
10- } )
2+ const { Octokit } = require ( '@octokit/rest' ) ;
3+
4+ const octokit = new Octokit ( {
5+ userAgent : 'FanOutFanInCrawler' ,
6+ auth : `token ${ process . env [ 'GitHubToken' ] } `
7+ } ) ;
118
129module . exports = async function ( context ) {
1310 // `input` here is retrieved from the Orchestrator function `callActivity` input parameter
@@ -18,7 +15,7 @@ module.exports = async function(context) {
1815
1916 do {
2017 // retrieves a list of open issues from a specific repository
21- var result = await octokit . issues . getForRepo ( {
18+ var result = await octokit . issues . listForRepo ( {
2219 owner : input . owner . login ,
2320 repo : input . name ,
2421 state : 'open' ,
Original file line number Diff line number Diff line change 44 "FUNCTIONS_WORKER_RUNTIME" : " node" ,
55 "AzureWebJobsStorage" : " UseDevelopmentStorage=true" ,
66 "AzureWebJobsDashboard" : " UseDevelopmentStorage=true" ,
7- "AzureWebJobsSecretStorageType " : " files " ,
7+ "FUNCTIONS_V2_COMPATIBILITY_MODE " : true ,
88 "GitHubToken" : " YOUR TOKEN HERE"
99 }
1010}
You can’t perform that action at this time.
0 commit comments