File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -32,15 +32,6 @@ function findEmailCommitAPI(apiData) {
3232 }
3333}
3434
35- function findEmailUserAPI(userAPIData) {
36- if (userAPIData != null && userAPIData.data != null && userAPIData.data.email != null && userAPIData.data.email != "") {
37- return userAPIData.data.email;
38- }
39- else {
40- return null;
41- }
42- }
43-
4435try {
4536 //inputs defined in action metadata file
4637 const usernameForEmail = core.getInput('github-username');
5748 });
5849
5950 // Search the full html of the page for the email
60- let emailUserpage = findEmailUserAPI(userAPIData);
51+ let emailUserpage = null;
52+ if (userAPIData != null && userAPIData.data != null && userAPIData.data.email != null && userAPIData.data.email != "") {
53+ emailUserpage = userAPIData.data.email;
54+ }
6155
6256 //email not found on page, fallback to old method to attempt email retrieval
6357 if (emailUserpage == null) {
8680 });
8781 }
8882 else {
89- console.log(`[*] Found ${usernameForEmail}\'s email: ${emailAPI }`)
90- core.setOutput("email", emailAPI );
83+ console.log(`[*] Found ${usernameForEmail}\'s email: ${emailUserpage }`)
84+ core.setOutput("email", emailUserpage );
9185 }
9286
9387} catch (error) {
Original file line number Diff line number Diff line change @@ -22,15 +22,6 @@ function findEmailCommitAPI(apiData) {
2222 }
2323}
2424
25- function findEmailUserAPI ( userAPIData ) {
26- if ( userAPIData != null && userAPIData . data != null && userAPIData . data . email != null && userAPIData . data . email != "" ) {
27- return userAPIData . data . email ;
28- }
29- else {
30- return null ;
31- }
32- }
33-
3425try {
3526 //inputs defined in action metadata file
3627 const usernameForEmail = core . getInput ( 'github-username' ) ;
4738 } ) ;
4839
4940 // Search the full html of the page for the email
50- let emailUserpage = findEmailUserAPI ( userAPIData ) ;
41+ let emailUserpage = null ;
42+ if ( userAPIData != null && userAPIData . data != null && userAPIData . data . email != null && userAPIData . data . email != "" ) {
43+ emailUserpage = userAPIData . data . email ;
44+ }
5145
5246 //email not found on page, fallback to old method to attempt email retrieval
5347 if ( emailUserpage == null ) {
7670 } ) ;
7771 }
7872 else {
79- console . log ( `[*] Found ${ usernameForEmail } \'s email: ${ emailAPI } ` )
80- core . setOutput ( "email" , emailAPI ) ;
73+ console . log ( `[*] Found ${ usernameForEmail } \'s email: ${ emailUserpage } ` )
74+ core . setOutput ( "email" , emailUserpage ) ;
8175 }
8276
8377} catch ( error ) {
You can’t perform that action at this time.
0 commit comments