fix title bug

This commit is contained in:
Domai 2023-09-24 15:10:04 +02:00
parent a2afb77cea
commit e2cc3993a8
No known key found for this signature in database
GPG key ID: 2FBD8C921EB5B019
2 changed files with 9 additions and 9 deletions

View file

@ -1,6 +1,6 @@
import * as core from "@actions/core"; import * as core from "@actions/core";
import * as fs from "fs"; import * as fs from "fs";
import themes from './themes/themes.json' import themes from "./themes/themes.json";
import { fetchProfile, fetchTopLanguages, fetchHistory } from "./src/fetcher"; import { fetchProfile, fetchTopLanguages, fetchHistory } from "./src/fetcher";
import ProfileCard from "./src/cards/ProfileCard"; import ProfileCard from "./src/cards/ProfileCard";
import TopLanguagesCard from "./src/cards/TopLanguagesCard"; import TopLanguagesCard from "./src/cards/TopLanguagesCard";
@ -32,7 +32,9 @@ async function main() {
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")
: `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"),
@ -60,7 +62,9 @@ async function main() {
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")
: `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"),
@ -84,8 +88,7 @@ async function main() {
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"),
@ -105,7 +108,6 @@ async function main() {
console.log(`Generated ./codestats_history_${username}.svg`); console.log(`Generated ./codestats_history_${username}.svg`);
fs.writeFileSync(`./codestats_history_${username}.svg`, historycard); fs.writeFileSync(`./codestats_history_${username}.svg`, historycard);
} catch (error) { } catch (error) {
if (error instanceof Error) { if (error instanceof Error) {
core.setFailed(error.message); core.setFailed(error.message);
@ -115,4 +117,4 @@ async function main() {
} }
} }
main() main();

View file

@ -23,7 +23,6 @@ inputs:
description: Change the cards title description: Change the cards title
required: false required: false
type: string type: string
default: "`Code::Stats of ${username}`"
profile_card_hide_lines: profile_card_hide_lines:
description: "Hide specific line, eg: `xp` or `xp,recent_xp`" description: "Hide specific line, eg: `xp` or `xp,recent_xp`"
@ -53,7 +52,6 @@ inputs:
description: Change the cards title description: Change the cards title
required: false required: false
type: string type: string
default: "`Code::Stats of ${username}`"
toplangs_card_language_count: toplangs_card_language_count:
description: Change the number of languages shown before going to Others description: Change the number of languages shown before going to Others