debug action

This commit is contained in:
Domai 2023-09-24 15:26:57 +02:00
parent 8ff1661ff4
commit 72f7e298b2
No known key found for this signature in database
GPG key ID: 2FBD8C921EB5B019
2 changed files with 46 additions and 46 deletions

View file

@ -18,6 +18,7 @@ async function main() {
const username = core.getInput("username"); const username = core.getInput("username");
// Fetch Code::Stats API // Fetch Code::Stats API
console.log(`Fetch account data: codestats.net/users/${username}`);
const profile = await fetchProfile(username); const profile = await fetchProfile(username);
const toplang = await fetchTopLanguages(username); const toplang = await fetchTopLanguages(username);
const history = await fetchHistory( const history = await fetchHistory(
@ -28,19 +29,19 @@ async function main() {
// Generate Profile Summary Card // Generate Profile Summary Card
const profilecard = ReactDOMServer.renderToStaticMarkup( const profilecard = ReactDOMServer.renderToStaticMarkup(
new ProfileCard(profile.username, profile.xp, profile.recentXp, { new ProfileCard(profile.username, profile.xp, profile.recentXp, {
hide: parseArray(core.getInput("profile_card_hide_lines")), // hide: parseArray(core.getInput("profile_card_hide_lines")),
show_icons: core.getBooleanInput("profile_card_show_icons"), // show_icons: core.getBooleanInput("profile_card_show_icons"),
hide_rank: core.getBooleanInput("profile_card_hide_rank"), // hide_rank: core.getBooleanInput("profile_card_hide_rank"),
line_height: parseNumber(core.getInput("profile_card_line_height")), // line_height: parseNumber(core.getInput("profile_card_line_height")),
title: core.getInput("profile_card_title") // title: core.getInput("profile_card_title")
? core.getInput("profile_card_title") // ? core.getInput("profile_card_title")
: `Code::Stats of ${username}`, // : `Code::Stats of ${username}`,
title_color: core.getInput("common_title_color"), // title_color: core.getInput("common_title_color"),
icon_color: core.getInput("common_icon_color"), // icon_color: core.getInput("common_icon_color"),
text_color: core.getInput("common_text_color"), // text_color: core.getInput("common_text_color"),
bg_color: core.getInput("common_bg_color"), // bg_color: core.getInput("common_bg_color"),
hide_title: core.getBooleanInput("common_hide_title"), // hide_title: core.getBooleanInput("common_hide_title"),
hide_border: core.getBooleanInput("common_hide_border"), // hide_border: core.getBooleanInput("common_hide_border"),
theme: theme:
core.getInput("theme") in themes core.getInput("theme") in themes
? (core.getInput("theme") as keyof typeof themes) ? (core.getInput("theme") as keyof typeof themes)
@ -54,22 +55,22 @@ async function main() {
// Generate Top Languages Card // Generate Top Languages Card
const toplangcard = ReactDOMServer.renderToStaticMarkup( const toplangcard = ReactDOMServer.renderToStaticMarkup(
new TopLanguagesCard(username, toplang.langs, { new TopLanguagesCard(username, toplang.langs, {
hide: parseArray(core.getInput("common_hide_languages")), // hide: parseArray(core.getInput("common_hide_languages")),
language_count: parseNumber( // language_count: parseNumber(
core.getInput("toplangs_card_language_count") // core.getInput("toplangs_card_language_count")
), // ),
card_width: 500, // card_width: 500,
layout: core.getBooleanInput("toplangs_card_compact_layout") // layout: core.getBooleanInput("toplangs_card_compact_layout")
? "compact" // ? "compact"
: undefined, // : undefined,
title: core.getInput("toplangs_card_title") // title: core.getInput("toplangs_card_title")
? core.getInput("toplangs_card_title") // ? core.getInput("toplangs_card_title")
: `Code::Stats of ${username}`, // : `Code::Stats of ${username}`,
title_color: core.getInput("common_title_color"), // title_color: core.getInput("common_title_color"),
text_color: core.getInput("common_text_color"), // text_color: core.getInput("common_text_color"),
bg_color: core.getInput("common_bg_color"), // bg_color: core.getInput("common_bg_color"),
hide_title: core.getBooleanInput("common_hide_title"), // hide_title: core.getBooleanInput("common_hide_title"),
hide_border: core.getBooleanInput("common_hide_border"), // hide_border: core.getBooleanInput("common_hide_border"),
theme: theme:
core.getInput("theme") in themes core.getInput("theme") in themes
? (core.getInput("theme") as keyof typeof themes) ? (core.getInput("theme") as keyof typeof themes)
@ -83,22 +84,22 @@ async function main() {
// Generate History Card // Generate History Card
const historycard = ReactDOMServer.renderToStaticMarkup( const historycard = ReactDOMServer.renderToStaticMarkup(
new HistoryCard(username, history, { new HistoryCard(username, history, {
hide: parseArray(core.getInput("common_hide_languages")), // hide: parseArray(core.getInput("common_hide_languages")),
language_count: parseNumber( // language_count: parseNumber(
core.getInput("history_card_language_count") // core.getInput("history_card_language_count")
), // ),
hide_legend: core.getBooleanInput("history_card_hide_legend"), // hide_legend: core.getBooleanInput("history_card_hide_legend"),
reverse_order: core.getBooleanInput("history_card_reverse_order"), // reverse_order: core.getBooleanInput("history_card_reverse_order"),
width: 500, // width: 500,
height: 300, // height: 300,
title_color: core.getInput("common_title_color"), // title_color: core.getInput("common_title_color"),
text_color: core.getInput("common_text_color"), // text_color: core.getInput("common_text_color"),
bg_color: core.getInput("common_bg_color"), // bg_color: core.getInput("common_bg_color"),
layout: core.getBooleanInput("history_card_horizontal_layout") // layout: core.getBooleanInput("history_card_horizontal_layout")
? "horizontal" // ? "horizontal"
: undefined, // : undefined,
hide_title: core.getBooleanInput("common_hide_title"), // hide_title: core.getBooleanInput("common_hide_title"),
hide_border: core.getBooleanInput("common_hide_border"), // hide_border: core.getBooleanInput("common_hide_border"),
theme: theme:
core.getInput("theme") in themes core.getInput("theme") in themes
? (core.getInput("theme") as keyof typeof themes) ? (core.getInput("theme") as keyof typeof themes)

View file

@ -21,7 +21,6 @@
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"dev": "ts-node ./index.ts", "dev": "ts-node ./index.ts",
"action": "ts-node ./action.ts",
"build": "tsc --project ./tsconfig.json", "build": "tsc --project ./tsconfig.json",
"start": "node dist/index.js", "start": "node dist/index.js",
"theme-readme-gen": "ts-node scripts/generate-theme-doc" "theme-readme-gen": "ts-node scripts/generate-theme-doc"