update action
This commit is contained in:
		
							parent
							
								
									210fcc8676
								
							
						
					
					
						commit
						9530e145dd
					
				
					 2 changed files with 8 additions and 71 deletions
				
			
		
							
								
								
									
										38
									
								
								action.ts
									
										
									
									
									
								
							
							
						
						
									
										38
									
								
								action.ts
									
										
									
									
									
								
							|  | @ -15,9 +15,6 @@ import { | ||||||
| 
 | 
 | ||||||
| async function main() { | async function main() { | ||||||
| 
 | 
 | ||||||
|   printInputVars(); |  | ||||||
|   core.setFailed('Does GitHub reconize this change?'); |  | ||||||
| 
 |  | ||||||
|   try { |   try { | ||||||
|     const username = core.getInput("username"); |     const username = core.getInput("username"); | ||||||
| 
 | 
 | ||||||
|  | @ -122,39 +119,4 @@ async function main() { | ||||||
|   } |   } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function printInputVars() { |  | ||||||
|   console.log('username: '+core.getInput("username")); |  | ||||||
|   console.log('profile_card_hide_lines: '+parseArray(core.getInput("profile_card_hide_lines"))); |  | ||||||
|   console.log( |  | ||||||
|     "profile_card_show_icons: " + core.getBooleanInput("profile_card_show_icons") |  | ||||||
|   ); |  | ||||||
|   console.log( |  | ||||||
|     "profile_card_hide_rank: " + core.getBooleanInput("profile_card_hide_rank") |  | ||||||
|   ); |  | ||||||
|   console.log( |  | ||||||
|     "profile_card_line_height: " + |  | ||||||
|       parseNumber(core.getInput("profile_card_line_height")) |  | ||||||
|   ); |  | ||||||
|   console.log( |  | ||||||
|     "profile_card_title: " + core.getInput("profile_card_title") |  | ||||||
|       ? core.getInput("profile_card_title") |  | ||||||
|       : `Code::Stats of <username var>` |  | ||||||
|   ); |  | ||||||
|   console.log("common_title_color" + core.getInput("common_title_color")); |  | ||||||
|   console.log('common_icon_color: '+ core.getInput("common_icon_color")); |  | ||||||
|   console.log("common_text_color: " + core.getInput("common_text_color")); |  | ||||||
|   console.log("common_bg_color: " + core.getInput("common_bg_color")); |  | ||||||
|   console.log( |  | ||||||
|     "common_hide_title: " + core.getBooleanInput("common_hide_title") |  | ||||||
|   ); |  | ||||||
|   console.log( |  | ||||||
|     "common_hide_border: " + core.getBooleanInput("common_hide_border") |  | ||||||
|   ); |  | ||||||
|   console.log('theme: ' +  |  | ||||||
|     core.getInput("theme") in themes |  | ||||||
|       ? (core.getInput("theme") as keyof typeof themes) |  | ||||||
|       : "default" |  | ||||||
|   ); |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| main(); | main(); | ||||||
|  |  | ||||||
							
								
								
									
										41
									
								
								dist/action.js
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										41
									
								
								dist/action.js
									
										
									
									
										vendored
									
									
								
							|  | @ -77,22 +77,18 @@ function main() { | ||||||
|         return __generator(this, function (_a) { |         return __generator(this, function (_a) { | ||||||
|             switch (_a.label) { |             switch (_a.label) { | ||||||
|                 case 0: |                 case 0: | ||||||
|                     printInputVars(); |                     _a.trys.push([0, 4, , 5]); | ||||||
|                     core.setFailed('Does GitHub reconize this change?'); |  | ||||||
|                     _a.label = 1; |  | ||||||
|                 case 1: |  | ||||||
|                     _a.trys.push([1, 5, , 6]); |  | ||||||
|                     username = core.getInput("username"); |                     username = core.getInput("username"); | ||||||
|                     // Fetch Code::Stats API
 |                     // Fetch Code::Stats API
 | ||||||
|                     console.log("Fetch account data: codestats.net/users/".concat(username)); |                     console.log("Fetch account data: codestats.net/users/".concat(username)); | ||||||
|                     return [4 /*yield*/, (0, fetcher_1.fetchProfile)(username)]; |                     return [4 /*yield*/, (0, fetcher_1.fetchProfile)(username)]; | ||||||
|                 case 2: |                 case 1: | ||||||
|                     profile = _a.sent(); |                     profile = _a.sent(); | ||||||
|                     return [4 /*yield*/, (0, fetcher_1.fetchTopLanguages)(username)]; |                     return [4 /*yield*/, (0, fetcher_1.fetchTopLanguages)(username)]; | ||||||
|                 case 3: |                 case 2: | ||||||
|                     toplang = _a.sent(); |                     toplang = _a.sent(); | ||||||
|                     return [4 /*yield*/, (0, fetcher_1.fetchHistory)(username, (0, utils_1.parseNumber)(core.getInput("history_card_days_count")))]; |                     return [4 /*yield*/, (0, fetcher_1.fetchHistory)(username, (0, utils_1.parseNumber)(core.getInput("history_card_days_count")))]; | ||||||
|                 case 4: |                 case 3: | ||||||
|                     history_1 = _a.sent(); |                     history_1 = _a.sent(); | ||||||
|                     profilecard = server_1.default.renderToStaticMarkup(new ProfileCard_1.default(profile.username, profile.xp, profile.recentXp, { |                     profilecard = server_1.default.renderToStaticMarkup(new ProfileCard_1.default(profile.username, profile.xp, profile.recentXp, { | ||||||
|                         hide: (0, utils_1.parseArray)(core.getInput("profile_card_hide_lines")), |                         hide: (0, utils_1.parseArray)(core.getInput("profile_card_hide_lines")), | ||||||
|  | @ -156,8 +152,8 @@ function main() { | ||||||
|                     }).render()); |                     }).render()); | ||||||
|                     console.log("Generated ./codestats_history_".concat(username, ".svg")); |                     console.log("Generated ./codestats_history_".concat(username, ".svg")); | ||||||
|                     fs.writeFileSync("./codestats_history_".concat(username, ".svg"), historycard); |                     fs.writeFileSync("./codestats_history_".concat(username, ".svg"), historycard); | ||||||
|                     return [3 /*break*/, 6]; |                     return [3 /*break*/, 5]; | ||||||
|                 case 5: |                 case 4: | ||||||
|                     error_1 = _a.sent(); |                     error_1 = _a.sent(); | ||||||
|                     if (error_1 instanceof Error) { |                     if (error_1 instanceof Error) { | ||||||
|                         core.setFailed(error_1.message); |                         core.setFailed(error_1.message); | ||||||
|  | @ -165,31 +161,10 @@ function main() { | ||||||
|                     else { |                     else { | ||||||
|                         console.log(error_1); |                         console.log(error_1); | ||||||
|                     } |                     } | ||||||
|                     return [3 /*break*/, 6]; |                     return [3 /*break*/, 5]; | ||||||
|                 case 6: return [2 /*return*/]; |                 case 5: return [2 /*return*/]; | ||||||
|             } |             } | ||||||
|         }); |         }); | ||||||
|     }); |     }); | ||||||
| } | } | ||||||
| function printInputVars() { |  | ||||||
|     console.log('username: ' + core.getInput("username")); |  | ||||||
|     console.log('profile_card_hide_lines: ' + (0, utils_1.parseArray)(core.getInput("profile_card_hide_lines"))); |  | ||||||
|     console.log("profile_card_show_icons: " + core.getBooleanInput("profile_card_show_icons")); |  | ||||||
|     console.log("profile_card_hide_rank: " + core.getBooleanInput("profile_card_hide_rank")); |  | ||||||
|     console.log("profile_card_line_height: " + |  | ||||||
|         (0, utils_1.parseNumber)(core.getInput("profile_card_line_height"))); |  | ||||||
|     console.log("profile_card_title: " + core.getInput("profile_card_title") |  | ||||||
|         ? core.getInput("profile_card_title") |  | ||||||
|         : "Code::Stats of <username var>"); |  | ||||||
|     console.log("common_title_color" + core.getInput("common_title_color")); |  | ||||||
|     console.log('common_icon_color: ' + core.getInput("common_icon_color")); |  | ||||||
|     console.log("common_text_color: " + core.getInput("common_text_color")); |  | ||||||
|     console.log("common_bg_color: " + core.getInput("common_bg_color")); |  | ||||||
|     console.log("common_hide_title: " + core.getBooleanInput("common_hide_title")); |  | ||||||
|     console.log("common_hide_border: " + core.getBooleanInput("common_hide_border")); |  | ||||||
|     console.log('theme: ' + |  | ||||||
|         core.getInput("theme") in themes_json_1.default |  | ||||||
|         ? core.getInput("theme") |  | ||||||
|         : "default"); |  | ||||||
| } |  | ||||||
| main(); | main(); | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Domai
						Domai