@@ -19,9 +19,9 @@ const parsedArgs = await parseArgs()
1919
2020 protocol : {
2121 describe :
22- "the protocol to use to pull the remote repository, either SSH or " +
23- "HTTP (defaults to SSH if a public SSH key is found for the current " +
24- "user, otherwise default to HTTP)" ,
22+ "the protocol to use to pull the remote repository, either SSH or "
23+ + "HTTP (defaults to SSH if a public SSH key is found for the current "
24+ + "user, otherwise default to HTTP)" ,
2525 string : true ,
2626 } ,
2727 login : {
@@ -50,8 +50,8 @@ const parsedArgs = await parseArgs()
5050 [ "key-part" ] : {
5151 ...cliArgs [ "key-part" ] ,
5252 describe :
53- cliArgs [ "key-part" ] . describe +
54- " If not provided, it will be extracted from the PR comments." ,
53+ cliArgs [ "key-part" ] . describe
54+ + " If not provided, it will be extracted from the PR comments." ,
5555 } ,
5656 } )
5757 . command (
@@ -63,16 +63,16 @@ const parsedArgs = await parseArgs()
6363 type : "string" ,
6464 describe : "URL to the GitHub pull request" ,
6565 } ) ;
66- }
66+ } ,
6767 ) . argv ;
6868
69- const privateKey =
70- parsedArgs . key === "-"
69+ const privateKey
70+ = parsedArgs . key === "-"
7171 ? await readStdIn ( false )
7272 : parsedArgs . key && ( await fs . readFile ( parsedArgs . key ) ) ;
7373
7474const prUrlInfo = / ^ h t t p s : \/ \/ g i t h u b \. c o m \/ ( [ ^ / ] + ) \/ ( [ ^ / ] + ) \/ p u l l \/ ( \d + ) $ / . exec (
75- parsedArgs [ "pr-url" ] as string
75+ parsedArgs [ "pr-url" ] as string ,
7676) ;
7777
7878if ( prUrlInfo == null ) {
@@ -81,7 +81,7 @@ if (prUrlInfo == null) {
8181
8282const [ , owner , repo , prNumber ] = prUrlInfo ;
8383console . warn (
84- `Looking into GitHub pull request ${ owner } /${ repo } #${ prNumber } ...`
84+ `Looking into GitHub pull request ${ owner } /${ repo } #${ prNumber } ...` ,
8585) ;
8686
8787const query = `query PR($prid: Int!, $owner: String!, $repo: String!) {
@@ -126,8 +126,8 @@ const { data } = JSON.parse(
126126 "-f" ,
127127 `query=${ query } ` ,
128128 ] ,
129- { captureStdout : true }
130- )
129+ { captureStdout : true } ,
130+ ) ,
131131) ;
132132
133133const { pullRequest } = data . repository ;
@@ -154,31 +154,31 @@ const files = await runChildProcessAsync(
154154 "--jq" ,
155155 ".files.[] | .filename" ,
156156 ] ,
157- { captureStdout : true }
157+ { captureStdout : true } ,
158158) ;
159159
160160const voteFileCanonicalName = "vote.yml" ;
161161const subPath = files
162162 . split ( "\n" )
163163 . find (
164- ( path ) =>
165- path === voteFileCanonicalName ||
166- path . endsWith ( `/${ voteFileCanonicalName } ` )
164+ path =>
165+ path === voteFileCanonicalName
166+ || path . endsWith ( `/${ voteFileCanonicalName } ` ) ,
167167 )
168168 ?. slice ( 0 , - voteFileCanonicalName . length ) ;
169169
170170const handle = parsedArgs . login || data . viewer . login ;
171171
172- const protocol =
173- parsedArgs . protocol ?? ( data . viewer . publicKeys . totalCount ? "ssh" : "http" ) ;
172+ const protocol
173+ = parsedArgs . protocol ?? ( data . viewer . publicKeys . totalCount ? "ssh" : "http" ) ;
174174
175175function getHTTPRepoURL ( repoURL : string , login : string ) {
176176 const url = new URL ( repoURL + ".git" ) ;
177177 url . username = login ;
178178 return url . toString ( ) ;
179179}
180- const repoURL =
181- protocol === "ssh"
180+ const repoURL
181+ = protocol === "ssh"
182182 ? data . repository . sshUrl
183183 : getHTTPRepoURL ( data . repository . url , handle ) ;
184184
@@ -191,14 +191,14 @@ console.warn("All relevant information has been retrieved:", {
191191} ) ;
192192
193193async function getKeyPartsFromComments ( ) {
194- const shamirKeyPartComment =
195- / \n - - - - - B E G I N S H A M I R K E Y P A R T - - - - - \n ( [ a - z A - Z 0 - 9 + / \s ] + = { 0 , 2 } ) \n - - - - - E N D S H A M I R K E Y P A R T - - - - - \n / ;
194+ const shamirKeyPartComment
195+ = / \n - - - - - B E G I N S H A M I R K E Y P A R T - - - - - \n ( [ a - z A - Z 0 - 9 + / \s ] + = { 0 , 2 } ) \n - - - - - E N D S H A M I R K E Y P A R T - - - - - \n / ;
196196 const { comments } = JSON . parse (
197197 await runChildProcessAsync (
198198 parsedArgs [ "gh-binary" ] as string ,
199199 [ "pr" , "view" , parsedArgs [ "pr-url" ] , "--json" , "comments" ] ,
200- { captureStdout : true }
201- )
200+ { captureStdout : true } ,
201+ ) ,
202202 ) ;
203203
204204 const results = [ ] ;
@@ -237,12 +237,12 @@ if (parsedArgs["post-comment"]) {
237237 ] ) ;
238238} else {
239239 console . log (
240- "To publish the results, you should use `--post-comment --commit-json-summary` CLI flags."
240+ "To publish the results, you should use `--post-comment --commit-json-summary` CLI flags." ,
241241 ) ;
242242 console . log (
243243 "Participation:" ,
244244 Math . round ( summary . participation * 100_00 ) / 1_00 ,
245- "%"
245+ "%" ,
246246 ) ;
247247 console . log ( "Raw results:" , summary . result ) ;
248248}
0 commit comments