@@ -6,6 +6,7 @@ const IGNORE_REPOSITORIES = require("./lib/ignored-repositories");
66const toLabelsList = require ( "./lib/to-labels-list" ) ;
77const validateLabnels = require ( "./lib/validate-labels" ) ;
88const setCard = require ( "./lib/set-card" ) ;
9+ const normalizeLabels = require ( "./lib/normalize-labels" ) ;
910const Octokit = require ( "./lib/octokit" ) ;
1011
1112run ( ) ;
@@ -24,7 +25,7 @@ async function run() {
2425 type : "public" ,
2526 }
2627 ) ) {
27- for ( const repository of response . data . slice ( 3 ) ) {
28+ for ( const repository of response . data ) {
2829 console . log ( "-" . repeat ( 80 ) ) ;
2930
3031 if ( repository . archived ) {
@@ -37,59 +38,59 @@ async function run() {
3738 continue ;
3839 }
3940
40- console . log ( `Loading issues for ${ repository . name } ` ) ;
4141 const owner = repository . owner . login ;
4242 const repo = repository . name ;
4343
44- console . log ( "loading issues" ) ;
45-
46- // https://developer.github.com/v3/issues/#list-repository-issues
47- for await ( const response of octokit . paginate . iterator (
48- "GET /repos/:owner/:repo/issues" ,
49- {
50- owner,
51- repo,
52- state : "open" ,
53- }
54- ) ) {
55- for ( const issue of response . data ) {
56- if ( issue . pull_request ) {
57- // pull requests are returned in the response, but their IDs are not the
58- continue ;
59- }
60-
61- validateLabnels ( issue ) ;
62-
63- console . log ( `- ${ issue . html_url } ${ toLabelsList ( issue ) } ` ) ;
64-
65- await setCard ( octokit , issue ) ;
66- }
67- }
68-
69- console . log ( "loading pull requests" ) ;
70-
71- // https://developer.github.com/v3/pulls/#list-pull-requests
72- for await ( const response of octokit . paginate . iterator (
73- "GET /repos/:owner/:repo/pulls" ,
74- {
75- owner,
76- repo,
77- state : "open" ,
78- }
79- ) ) {
80- for ( const pullRequest of response . data ) {
81- validateLabnels ( pullRequest ) ;
82-
83- console . log (
84- `- ${ pullRequest . html_url } ${ toLabelsList ( pullRequest ) } `
85- ) ;
86-
87- await setCard ( octokit , pullRequest ) ;
88- }
89- }
44+ // console.log(`Loading issues for ${repo}` );
45+
46+ // // https://developer.github.com/v3/issues/#list-repository-issues
47+ // for await (const response of octokit.paginate.iterator(
48+ // "GET /repos/:owner/:repo/issues",
49+ // {
50+ // owner,
51+ // repo,
52+ // state: "open",
53+ // }
54+ // )) {
55+ // for (const issue of response.data) {
56+ // if (issue.pull_request) {
57+ // // pull requests are returned in the response, but their IDs are not the
58+ // continue;
59+ // }
60+
61+ // validateLabnels(issue);
62+
63+ // console.log(`- ${issue.html_url} ${toLabelsList(issue)}`);
64+
65+ // await setCard(octokit, issue);
66+ // }
67+ // }
68+
69+ // console.log(`Loading pull requests for ${repo}` );
70+
71+ // // https://developer.github.com/v3/pulls/#list-pull-requests
72+ // for await (const response of octokit.paginate.iterator(
73+ // "GET /repos/:owner/:repo/pulls",
74+ // {
75+ // owner,
76+ // repo,
77+ // state: "open",
78+ // }
79+ // )) {
80+ // for (const pullRequest of response.data) {
81+ // validateLabnels(pullRequest);
82+
83+ // console.log(
84+ // `- ${pullRequest.html_url} ${toLabelsList(pullRequest)}`
85+ // );
86+
87+ // await setCard(octokit, pullRequest);
88+ // }
89+ // }
9090
9191 // https://developer.github.com/v3/issues/labels/#list-all-labels-for-this-repository
92- // await normalizeLabels(octokit, { owner, repo });
92+ console . log ( `Normalizing labels for ${ repo } ` ) ;
93+ await normalizeLabels ( octokit , { owner, repo } ) ;
9394 }
9495 }
9596
0 commit comments