From e2cc3993a8076d324854e3a692f7f1f711df6ec2 Mon Sep 17 00:00:00 2001 From: Domai Date: Sun, 24 Sep 2023 15:10:04 +0200 Subject: [PATCH] fix title bug --- action.ts | 16 +++++++++------- action.yml | 2 -- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/action.ts b/action.ts index 242be35..29e7361 100644 --- a/action.ts +++ b/action.ts @@ -1,6 +1,6 @@ import * as core from "@actions/core"; 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 ProfileCard from "./src/cards/ProfileCard"; import TopLanguagesCard from "./src/cards/TopLanguagesCard"; @@ -32,7 +32,9 @@ async function main() { show_icons: core.getBooleanInput("profile_card_show_icons"), hide_rank: core.getBooleanInput("profile_card_hide_rank"), 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"), icon_color: core.getInput("common_icon_color"), text_color: core.getInput("common_text_color"), @@ -60,7 +62,9 @@ async function main() { layout: core.getBooleanInput("toplangs_card_compact_layout") ? "compact" : 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"), text_color: core.getInput("common_text_color"), bg_color: core.getInput("common_bg_color"), @@ -84,8 +88,7 @@ async function main() { core.getInput("history_card_language_count") ), 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, height: 300, title_color: core.getInput("common_title_color"), @@ -105,7 +108,6 @@ async function main() { console.log(`Generated ./codestats_history_${username}.svg`); fs.writeFileSync(`./codestats_history_${username}.svg`, historycard); - } catch (error) { if (error instanceof Error) { core.setFailed(error.message); @@ -115,4 +117,4 @@ async function main() { } } -main() \ No newline at end of file +main(); diff --git a/action.yml b/action.yml index 0c6f7e6..c9733bf 100644 --- a/action.yml +++ b/action.yml @@ -23,7 +23,6 @@ inputs: description: Change the cards title required: false type: string - default: "`Code::Stats of ${username}`" profile_card_hide_lines: description: "Hide specific line, eg: `xp` or `xp,recent_xp`" @@ -53,7 +52,6 @@ inputs: description: Change the cards title required: false type: string - default: "`Code::Stats of ${username}`" toplangs_card_language_count: description: Change the number of languages shown before going to Others