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,6 +32,15 @@ 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+
3544try {
3645 //inputs defined in action metadata file
3746 const usernameForEmail = core.getInput('github-username');
4857 });
4958
5059 // Search the full html of the page for the email
51- let emailUserpage = null;
52- if (userAPIData != null && userAPIData.data != null && userAPIData.data.email != null && userAPIData.data.email != "") {
53- emailUserpage = userAPIData.data.email;
54- }
60+ let emailUserpage = findEmailUserAPI(userAPIData);
5561
5662 //email not found on page, fallback to old method to attempt email retrieval
5763 if (emailUserpage == null) {
Original file line number Diff line number Diff line change @@ -22,6 +22,15 @@ 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+
2534try {
2635 //inputs defined in action metadata file
2736 const usernameForEmail = core . getInput ( 'github-username' ) ;
3847 } ) ;
3948
4049 // Search the full html of the page for the email
41- let emailUserpage = null ;
42- if ( userAPIData != null && userAPIData . data != null && userAPIData . data . email != null && userAPIData . data . email != "" ) {
43- emailUserpage = userAPIData . data . email ;
44- }
50+ let emailUserpage = findEmailUserAPI ( userAPIData ) ;
4551
4652 //email not found on page, fallback to old method to attempt email retrieval
4753 if ( emailUserpage == null ) {
You can’t perform that action at this time.
0 commit comments