File tree Expand file tree Collapse file tree 1 file changed +15
-22
lines changed
Expand file tree Collapse file tree 1 file changed +15
-22
lines changed Original file line number Diff line number Diff line change 11import dayjs from 'dayjs' ;
22import { ofetch } from 'ofetch' ;
3- import { consola } from 'consola' ;
43import semver from 'semver' ;
54import { execCommand , notNullish } from './shared' ;
65import { VERSION_REG } from './constant' ;
@@ -224,46 +223,40 @@ async function getResolvedAuthorLogin(github: GithubConfig, commitHashes: string
224223
225224 let login = '' ;
226225
227- // token not provided, skip github resolving
228- if ( ! token ) {
229- return login ;
230- }
231-
232226 try {
233227 const data = await ofetch ( `https://api.github.com/search/users?q=${ encodeURIComponent ( email ) } ` , {
234228 headers : getHeaders ( token )
235229 } ) ;
236230 login = data . items [ 0 ] . login ;
237- } catch ( e ) {
238- consola . log ( 'e: ' , e ) ;
231+ } catch { }
232+
233+ if ( login ) {
234+ return login ;
239235 }
240236
237+ try {
238+ const data = await ofetch ( `https://ungh.cc/users/find/${ email } ` ) ;
239+ login = data ?. user ?. username || '' ;
240+ } catch { }
241+
241242 if ( login ) {
242243 return login ;
243244 }
244245
246+ // token not provided, skip github resolving
247+ if ( ! token ) {
248+ return login ;
249+ }
250+
245251 if ( commitHashes . length ) {
246252 try {
247253 const data = await ofetch ( `https://api.github.com/repos/${ repo } /commits/${ commitHashes [ 0 ] } ` , {
248254 headers : getHeaders ( token )
249255 } ) ;
250256 login = data ?. author ?. login || '' ;
251- } catch ( e ) {
252- consola . log ( 'e: ' , e ) ;
253- }
257+ } catch { }
254258 }
255259
256- // try {
257- // const data = await ofetch(`https://ungh.cc/users/find/${email}`);
258- // login = data?.user?.username || '';
259- // } catch (e) {
260- // consola.log('e: ', e);
261- // }
262-
263- // if (login) {
264- // return login;
265- // }
266-
267260 return login ;
268261}
269262
You can’t perform that action at this time.
0 commit comments