From dc821229667cfd7f1fdabfd2e69987041b00d1bf Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 19 Jul 2026 14:27:30 +0000 Subject: [PATCH 01/11] feat: add title, column, no_frame, no_bg support to GitHub Action --- action.yml | 25 ++++++++++++++++++++++++- render_svg.ts | 34 +++++++++++++++++++--------------- 2 files changed, 43 insertions(+), 16 deletions(-) diff --git a/action.yml b/action.yml index 7b7c8642..f1eaeea7 100644 --- a/action.yml +++ b/action.yml @@ -15,6 +15,22 @@ inputs: description: "Theme for the card" required: false default: "default" + title: + description: "Comma-separated list of trophy titles to display (e.g. 'Stars,Commits')" + required: false + default: "" + column: + description: "Maximum number of columns (-1 for auto)" + required: false + default: "-1" + no_frame: + description: "Disable trophy frame borders" + required: false + default: "false" + no_bg: + description: "Disable card background" + required: false + default: "false" runs: using: "composite" steps: @@ -28,4 +44,11 @@ runs: env: GITHUB_TOKEN1: ${{ inputs.token }} run: | - deno run --allow-net --allow-env --allow-read --allow-write $GITHUB_ACTION_PATH/render_svg.ts "${{ inputs.username }}" "${{ inputs.output_path }}" "${{ inputs.theme }}" + deno run --allow-net --allow-env --allow-read --allow-write $GITHUB_ACTION_PATH/render_svg.ts \ + "${{ inputs.username }}" \ + "${{ inputs.output_path }}" \ + "${{ inputs.theme }}" \ + "${{ inputs.title }}" \ + "${{ inputs.column }}" \ + "${{ inputs.no_frame }}" \ + "${{ inputs.no_bg }}" diff --git a/render_svg.ts b/render_svg.ts index f870eee8..522f1251 100644 --- a/render_svg.ts +++ b/render_svg.ts @@ -3,10 +3,14 @@ import "https://deno.land/x/dotenv@v0.5.0/load.ts"; const username = Deno.args[0]; const outputPath = Deno.args[1] ?? "./assets/trophy.svg"; const themeName = Deno.args[2] ?? "default"; +const titleArg = Deno.args[3] ?? ""; +const columnArg = Deno.args[4] ?? "-1"; +const noFrameArg = Deno.args[5] ?? "false"; +const noBgArg = Deno.args[6] ?? "false"; if (!username) { console.error( - "Usage: deno run --allow-net --allow-env --allow-read --allow-write ./render_svg.ts USERNAME [OUTPUT_PATH] [THEME]", + "Usage: deno run --allow-net --allow-env --allow-read --allow-write ./render_svg.ts USERNAME [OUTPUT_PATH] [THEME] [TITLE] [COLUMN] [NO_FRAME] [NO_BG]", ); Deno.exit(1); } @@ -14,6 +18,7 @@ if (!username) { import { GithubApiService } from "./src/Services/GithubApiService.ts"; import { Card } from "./src/card.ts"; import { COLORS } from "./src/theme.ts"; +import { CONSTANTS } from "./src/utils.ts"; async function main() { console.log("Starting trophy render..."); @@ -21,6 +26,13 @@ async function main() { console.log("Output path:", outputPath); console.log("Theme:", themeName); + const titles: Array = titleArg + ? titleArg.split(",").map((t) => t.trim()).filter((t) => t.length > 0) + : []; + const maxColumn = parseInt(columnArg); + const noFrame = noFrameArg === "true"; + const noBackground = noBgArg === "true"; + const svc = new GithubApiService(); const userInfoOrError = await svc.requestUserInfo(username); @@ -36,22 +48,14 @@ async function main() { const userInfo = userInfoOrError as any; - const panelSize = 115; - const maxRow = 10; - const maxColumn = -1; // auto - const marginWidth = 10; - const marginHeight = 10; - const noBackground = false; - const noFrame = false; - const card = new Card( + titles, [], - [], - maxColumn, - maxRow, - panelSize, - marginWidth, - marginHeight, + isNaN(maxColumn) ? -1 : maxColumn, + CONSTANTS.DEFAULT_MAX_ROW, + CONSTANTS.DEFAULT_PANEL_SIZE, + CONSTANTS.DEFAULT_MARGIN_W, + CONSTANTS.DEFAULT_MARGIN_H, noBackground, noFrame, ); From ea99ba12daa8c7466b5b3498370df04a3410d7a4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 19 Jul 2026 14:28:17 +0000 Subject: [PATCH 02/11] fix: use parseInt with radix 10 for column arg parsing --- render_svg.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/render_svg.ts b/render_svg.ts index 522f1251..022d574d 100644 --- a/render_svg.ts +++ b/render_svg.ts @@ -29,7 +29,7 @@ async function main() { const titles: Array = titleArg ? titleArg.split(",").map((t) => t.trim()).filter((t) => t.length > 0) : []; - const maxColumn = parseInt(columnArg); + const maxColumn = parseInt(columnArg, 10); const noFrame = noFrameArg === "true"; const noBackground = noBgArg === "true"; From b935dd78525258aa1ac3b9e434cfdfebf5f4717d Mon Sep 17 00:00:00 2001 From: Bengt Brodersen Date: Sun, 19 Jul 2026 16:42:42 +0200 Subject: [PATCH 03/11] Update action.yml --- action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/action.yml b/action.yml index f1eaeea7..bbab4942 100644 --- a/action.yml +++ b/action.yml @@ -11,6 +11,7 @@ inputs: token: description: "PAT or token to use for GitHub API" required: true + default: ${{ github.token }} theme: description: "Theme for the card" required: false From 4b5c20a887e83ed7cd963eb6a9575b88069b7175 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 19 Jul 2026 14:44:33 +0000 Subject: [PATCH 04/11] docs: update README GitHub Action example with correct ref and new inputs --- README.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4a0ccfd0..81abe391 100644 --- a/README.md +++ b/README.md @@ -594,7 +594,7 @@ given your username, (Enviroment Vars: See [env-example](env-example)). Usage: ```bash -deno run --allow-net --allow-env --allow-read --allow-write ./render_svg.ts USERNAME OUTPUT_DIR THEME +deno run --allow-net --allow-env --allow-read --allow-write ./render_svg.ts USERNAME [OUTPUT_PATH] [THEME] [TITLE] [COLUMN] [NO_FRAME] [NO_BG] ``` ## Generate an svg inside Github CI (Workflow) @@ -607,11 +607,17 @@ Usage: ```yaml - name: Generate trophy - uses: Erik-Donath/github-profile-trophy@feature/generate-svg + uses: ryo-ma/github-profile-trophy@master with: username: your-username output_path: trophy.svg token: ${{ secrets.GITHUB_TOKEN }} + # Optional inputs: + theme: default # Theme name (default: "default") + title: Stars,Commits # Comma-separated trophy titles to include (default: all) + column: -1 # Max columns, -1 for auto (default: -1) + no_frame: false # Disable trophy frame borders (default: false) + no_bg: false # Disable card background (default: false) ``` ## Self-hosting on Vercel From 9827f5d3a1cf3f48c1dbc96b04e976b75a8baae0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 20 Jul 2026 06:15:42 +0000 Subject: [PATCH 05/11] refactor: use CONSTANTS.DEFAULT_* for all arg defaults in render_svg.ts --- action.yml | 2 +- render_svg.ts | 19 +++++++++---------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/action.yml b/action.yml index bbab4942..81a522c1 100644 --- a/action.yml +++ b/action.yml @@ -23,7 +23,7 @@ inputs: column: description: "Maximum number of columns (-1 for auto)" required: false - default: "-1" + default: "8" no_frame: description: "Disable trophy frame borders" required: false diff --git a/render_svg.ts b/render_svg.ts index 022d574d..511f74dd 100644 --- a/render_svg.ts +++ b/render_svg.ts @@ -1,12 +1,16 @@ import "https://deno.land/x/dotenv@v0.5.0/load.ts"; +import { COLORS } from "./src/theme.ts"; +import { Card } from "./src/card.ts"; +import { CONSTANTS } from "./src/utils.ts"; +import { GithubApiService } from "./src/Services/GithubApiService.ts"; const username = Deno.args[0]; -const outputPath = Deno.args[1] ?? "./assets/trophy.svg"; +const outputPath = Deno.args[1] ?? "trophy.svg"; const themeName = Deno.args[2] ?? "default"; const titleArg = Deno.args[3] ?? ""; -const columnArg = Deno.args[4] ?? "-1"; -const noFrameArg = Deno.args[5] ?? "false"; -const noBgArg = Deno.args[6] ?? "false"; +const columnArg = Deno.args[4] ?? String(CONSTANTS.DEFAULT_MAX_COLUMN); +const noFrameArg = Deno.args[5] ?? String(CONSTANTS.DEFAULT_NO_FRAME); +const noBgArg = Deno.args[6] ?? String(CONSTANTS.DEFAULT_NO_BACKGROUND); if (!username) { console.error( @@ -15,11 +19,6 @@ if (!username) { Deno.exit(1); } -import { GithubApiService } from "./src/Services/GithubApiService.ts"; -import { Card } from "./src/card.ts"; -import { COLORS } from "./src/theme.ts"; -import { CONSTANTS } from "./src/utils.ts"; - async function main() { console.log("Starting trophy render..."); console.log("Username:", username); @@ -51,7 +50,7 @@ async function main() { const card = new Card( titles, [], - isNaN(maxColumn) ? -1 : maxColumn, + isNaN(maxColumn) ? CONSTANTS.DEFAULT_MAX_COLUMN : maxColumn, CONSTANTS.DEFAULT_MAX_ROW, CONSTANTS.DEFAULT_PANEL_SIZE, CONSTANTS.DEFAULT_MARGIN_W, From 4dba17557f01553ce771b7771ca844bc01297e6a Mon Sep 17 00:00:00 2001 From: Bengt Brodersen Date: Mon, 20 Jul 2026 08:17:51 +0200 Subject: [PATCH 06/11] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 81abe391..2bc69b64 100644 --- a/README.md +++ b/README.md @@ -615,7 +615,7 @@ Usage: # Optional inputs: theme: default # Theme name (default: "default") title: Stars,Commits # Comma-separated trophy titles to include (default: all) - column: -1 # Max columns, -1 for auto (default: -1) + column: 8 # Max columns (default: 8) no_frame: false # Disable trophy frame borders (default: false) no_bg: false # Disable card background (default: false) ``` From 102a1f18d485e01776840107b4c2633fac0dcc0d Mon Sep 17 00:00:00 2001 From: Bengt Brodersen Date: Mon, 20 Jul 2026 08:18:45 +0200 Subject: [PATCH 07/11] Update render_svg.ts --- render_svg.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/render_svg.ts b/render_svg.ts index 511f74dd..9898027f 100644 --- a/render_svg.ts +++ b/render_svg.ts @@ -5,7 +5,7 @@ import { CONSTANTS } from "./src/utils.ts"; import { GithubApiService } from "./src/Services/GithubApiService.ts"; const username = Deno.args[0]; -const outputPath = Deno.args[1] ?? "trophy.svg"; +const outputPath = Deno.args[1] ?? "./assets/trophy.svg"; const themeName = Deno.args[2] ?? "default"; const titleArg = Deno.args[3] ?? ""; const columnArg = Deno.args[4] ?? String(CONSTANTS.DEFAULT_MAX_COLUMN); From 7a5b1874d2c60317f6bbce2da11f87c7dc62c701 Mon Sep 17 00:00:00 2001 From: Bengt Brodersen Date: Mon, 20 Jul 2026 08:40:18 +0200 Subject: [PATCH 08/11] Add default values for inputs in action.yml --- action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/action.yml b/action.yml index 81a522c1..c30b7fe5 100644 --- a/action.yml +++ b/action.yml @@ -4,6 +4,7 @@ inputs: username: description: "GitHub username to generate the trophy for" required: true + default: ${{ github.repository_owner }} output_path: description: "Output path to write the SVG" required: true From 8623f187629741775e440271ca867698e8325d44 Mon Sep 17 00:00:00 2001 From: Bengt Brodersen Date: Mon, 20 Jul 2026 08:46:44 +0200 Subject: [PATCH 09/11] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2bc69b64..ece2eabf 100644 --- a/README.md +++ b/README.md @@ -607,7 +607,7 @@ Usage: ```yaml - name: Generate trophy - uses: ryo-ma/github-profile-trophy@master + uses: ryo-ma/github-profile-trophy@v1.0 with: username: your-username output_path: trophy.svg From 657a873ae224c74ecb81dcecab383138cd51223c Mon Sep 17 00:00:00 2001 From: Bengt Brodersen Date: Fri, 24 Jul 2026 17:39:09 +0200 Subject: [PATCH 10/11] Update render_svg.ts --- render_svg.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/render_svg.ts b/render_svg.ts index 9898027f..2f13ae94 100644 --- a/render_svg.ts +++ b/render_svg.ts @@ -8,7 +8,7 @@ const username = Deno.args[0]; const outputPath = Deno.args[1] ?? "./assets/trophy.svg"; const themeName = Deno.args[2] ?? "default"; const titleArg = Deno.args[3] ?? ""; -const columnArg = Deno.args[4] ?? String(CONSTANTS.DEFAULT_MAX_COLUMN); +const columnArg = Deno.args[4]; const noFrameArg = Deno.args[5] ?? String(CONSTANTS.DEFAULT_NO_FRAME); const noBgArg = Deno.args[6] ?? String(CONSTANTS.DEFAULT_NO_BACKGROUND); @@ -28,7 +28,7 @@ async function main() { const titles: Array = titleArg ? titleArg.split(",").map((t) => t.trim()).filter((t) => t.length > 0) : []; - const maxColumn = parseInt(columnArg, 10); + const maxColumn = columnArg ? parseInt(columnArg, 10) : titles.length; const noFrame = noFrameArg === "true"; const noBackground = noBgArg === "true"; From e78b0e2fc964598f7d960bd88940fe00f0190761 Mon Sep 17 00:00:00 2001 From: Bengt Brodersen Date: Fri, 24 Jul 2026 17:51:07 +0200 Subject: [PATCH 11/11] Update action.yml --- action.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/action.yml b/action.yml index c30b7fe5..f5ba35e9 100644 --- a/action.yml +++ b/action.yml @@ -22,9 +22,8 @@ inputs: required: false default: "" column: - description: "Maximum number of columns (-1 for auto)" + description: "Maximum number of columns" required: false - default: "8" no_frame: description: "Disable trophy frame borders" required: false