From f0961c7dba8bc77ef4b82b6caf16d9f545e90086 Mon Sep 17 00:00:00 2001
From: Erik Donath
Date: Mon, 26 Jan 2026 14:15:08 +0100
Subject: [PATCH 01/13] Wrote a simple render_svg.ts file that generates the
svg given an github username, theme and out path.
---
render_svg.ts | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 65 insertions(+)
create mode 100644 render_svg.ts
diff --git a/render_svg.ts b/render_svg.ts
new file mode 100644
index 00000000..319eea74
--- /dev/null
+++ b/render_svg.ts
@@ -0,0 +1,65 @@
+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";
+
+if (!username) {
+ console.error(
+ "Usage: deno run --allow-net --allow-env --allow-read --allow-write ./render_svg.ts USERNAME [OUTPUT_PATH] [THEME]",
+ );
+ Deno.exit(1);
+}
+
+import { GithubApiService } from "./src/Services/GithubApiService.ts";
+import { Card } from "./src/card.ts";
+import { COLORS } from "./src/theme.ts";
+
+async function main() {
+ console.log("Starting trophy render...");
+ console.log("Username:", username);
+ console.log("Output path:", outputPath);
+ console.log("Theme:", themeName);
+
+ const svc = new GithubApiService();
+
+ const userInfoOrError = await svc.requestUserInfo(username);
+
+ if (
+ !(userInfoOrError && (userInfoOrError as any).totalCommits !== undefined)
+ ) {
+ console.error(
+ "Failed to fetch user info. Check token, username and rate limits.",
+ );
+ Deno.exit(2);
+ }
+
+ 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(
+ [],
+ [],
+ maxColumn,
+ maxRow,
+ panelSize,
+ marginWidth,
+ marginHeight,
+ noBackground,
+ noFrame,
+ );
+ const theme = (COLORS as any)[themeName] ?? (COLORS as any).default;
+ const svg = card.render(userInfo, theme);
+
+ await Deno.writeTextFile(outputPath, svg);
+ console.log(`Wrote ${outputPath}`);
+}
+
+await main();
From 351aa337291e718d66c5929a0ab37611d04a9e34 Mon Sep 17 00:00:00 2001
From: Erik Donath
Date: Mon, 26 Jan 2026 14:15:58 +0100
Subject: [PATCH 02/13] render_svg.ts generates output dir if not exsists.
---
render_svg.ts | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/render_svg.ts b/render_svg.ts
index 319eea74..f870eee8 100644
--- a/render_svg.ts
+++ b/render_svg.ts
@@ -58,6 +58,14 @@ async function main() {
const theme = (COLORS as any)[themeName] ?? (COLORS as any).default;
const svg = card.render(userInfo, theme);
+ try {
+ const dir = outputPath.replace(/\/[^/]+$/, "");
+ if (dir) await Deno.mkdir(dir, { recursive: true });
+ } catch {
+ console.error("Failed to create directory. No permission?");
+ Deno.exit(3);
+ }
+
await Deno.writeTextFile(outputPath, svg);
console.log(`Wrote ${outputPath}`);
}
From eb469bd791e184d4f58d111cc0a094244ddebfbd Mon Sep 17 00:00:00 2001
From: Erik Donath
Date: Mon, 26 Jan 2026 14:20:48 +0100
Subject: [PATCH 03/13] Added Section to README.md that explains how to use the
render_svg.ts script.
---
README.md | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/README.md b/README.md
index 4ae558c9..8df78e01 100644
--- a/README.md
+++ b/README.md
@@ -566,6 +566,14 @@ https://github-profile-trophy.vercel.app/?username=ryo-ma&no-frame=true
+## Generate an svg file localy
+Using the render_svg.ts script you can generate your trophys as an svg file 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
+```
+
# Contribution Guide
Check [CONTRIBUTING.md](./CONTRIBUTING.md) for more details.
From 936e8841c12f92039da201886311d5c934b1f2d8 Mon Sep 17 00:00:00 2001
From: Erik Donath
Date: Mon, 26 Jan 2026 14:23:12 +0100
Subject: [PATCH 04/13] Added an github action that utilizes the render_svg.ts
script.
---
action.yml | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
create mode 100644 action.yml
diff --git a/action.yml b/action.yml
new file mode 100644
index 00000000..7aecc80c
--- /dev/null
+++ b/action.yml
@@ -0,0 +1,27 @@
+name: Generate GitHub Profile Trophy SVG
+description: Run the local generator script to produce an SVG.
+inputs:
+ username:
+ description: "GitHub username to generate the trophy for"
+ required: true
+ output_path:
+ description: "Output path to write the SVG"
+ required: true
+ default: "trophy.svg"
+ token:
+ description: "PAT or token to use for GitHub API"
+ required: true
+runs:
+ using: "composite"
+ steps:
+ - name: Setup Deno
+ uses: denoland/setup-deno@v1
+ with:
+ deno-version: v1.x
+
+ - name: Generate trophy
+ shell: bash
+ 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 }}"
From 481616808a69d4d3dc0dbf499866788fc37255e8 Mon Sep 17 00:00:00 2001
From: Erik Donath
Date: Mon, 26 Jan 2026 14:27:46 +0100
Subject: [PATCH 05/13] Added Usage of github action to README.md
---
README.md | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/README.md b/README.md
index 8df78e01..93368a93 100644
--- a/README.md
+++ b/README.md
@@ -574,6 +574,20 @@ Usage:
deno run --allow-net --allow-env --allow-read --allow-write ./render_svg.ts USERNAME OUTPUT_DIR THEME
```
+## Generate an svg inside Github CI (Workflow)
+Using the provided github action you can easly generate the trophy inside an github workflow. This eliminates the needs of an online service running but you have to manualy update rerun the action to update the file.
+
+Usage:
+```yaml
+- name: Generate trophy
+ uses: Erik-Donath/github-profile-trophy@feature/generate-svg
+ with:
+ username: your-username
+ output_path: trophy.svg
+ token: ${{ secrets.GITHUB_TOKEN }}
+```
+
+
# Contribution Guide
Check [CONTRIBUTING.md](./CONTRIBUTING.md) for more details.
From 3cca32cb04df6229416927938afac00ba03651ea Mon Sep 17 00:00:00 2001
From: Erik Donath
Date: Mon, 26 Jan 2026 14:30:42 +0100
Subject: [PATCH 06/13] Added simple CI Check if action runs.
---
.github/workflows/test-repository-action.yml | 26 ++++++++++++++++++++
1 file changed, 26 insertions(+)
create mode 100644 .github/workflows/test-repository-action.yml
diff --git a/.github/workflows/test-repository-action.yml b/.github/workflows/test-repository-action.yml
new file mode 100644
index 00000000..7fc0a671
--- /dev/null
+++ b/.github/workflows/test-repository-action.yml
@@ -0,0 +1,26 @@
+name: Test GitHub Profile Trophy Action
+on: [push, pull_request, workflow_dispatch]
+
+jobs:
+ test-trophy:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout this repo
+ uses: actions/checkout@v4
+ - name: Test Action
+ id: trophy
+ uses: ./.
+ with:
+ username: ${{ github.repository_owner }}
+ output_path: ./trophy.svg
+ token: ${{ secrets.GITHUB_TOKEN }}
+
+ - name: Verify SVG generated
+ run: |
+ if [ -f trophy.svg ]; then
+ echo "SVG exsists ($(wc -c < trophy.svg) Bytes)"
+ file trophy.svg
+ else
+ echo "SVG failed to generate"
+ exit 1
+ fi
From fc6cee3bbe3fe4583a7af86c9dbceda37836f534 Mon Sep 17 00:00:00 2001
From: Erik Donath
Date: Mon, 26 Jan 2026 14:34:00 +0100
Subject: [PATCH 07/13] Ran: deno fmt
---
README.md | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/README.md b/README.md
index 93368a93..142eaf7c 100644
--- a/README.md
+++ b/README.md
@@ -567,17 +567,24 @@ https://github-profile-trophy.vercel.app/?username=ryo-ma&no-frame=true
## Generate an svg file localy
-Using the render_svg.ts script you can generate your trophys as an svg file given your username, (Enviroment Vars: See [env-example](env-example)).
+
+Using the render_svg.ts script you can generate your trophys as an svg file
+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
```
## Generate an svg inside Github CI (Workflow)
-Using the provided github action you can easly generate the trophy inside an github workflow. This eliminates the needs of an online service running but you have to manualy update rerun the action to update the file.
+
+Using the provided github action you can easly generate the trophy inside an
+github workflow. This eliminates the needs of an online service running but you
+have to manualy update rerun the action to update the file.
Usage:
+
```yaml
- name: Generate trophy
uses: Erik-Donath/github-profile-trophy@feature/generate-svg
@@ -587,7 +594,6 @@ Usage:
token: ${{ secrets.GITHUB_TOKEN }}
```
-
# Contribution Guide
Check [CONTRIBUTING.md](./CONTRIBUTING.md) for more details.
From 6da9f631c057481f31580874ff11f1574562593c Mon Sep 17 00:00:00 2001
From: Erik Donath
Date: Thu, 29 Jan 2026 19:55:51 +0100
Subject: [PATCH 08/13] Add CLI interface with argument parsing and token
validation
---
render_svg.ts | 54 ++++++++++++++++++++++++++++++++++++++++++---------
1 file changed, 45 insertions(+), 9 deletions(-)
diff --git a/render_svg.ts b/render_svg.ts
index f870eee8..7e696072 100644
--- a/render_svg.ts
+++ b/render_svg.ts
@@ -1,16 +1,52 @@
import "https://deno.land/x/dotenv@v0.5.0/load.ts";
+import { parseArgs } from "https://deno.land/std@0.208.0/cli/parse_args.ts";
-const username = Deno.args[0];
-const outputPath = Deno.args[1] ?? "./assets/trophy.svg";
-const themeName = Deno.args[2] ?? "default";
+if(!Deno.env.get("GITHUB_TOKEN1")) {
+ console.error("Github Token is required!");
+ Deno.exit(1);
+}
+
+const args = parseArgs(Deno.args, {
+ boolean: ["help"],
+ string: ["file", "theme", "cols", "rows"],
+ default: { file: "./trophy.svg", theme: "default", cols: "-1", rows: "10" },
+ alias: { help: "h", file: "f", theme: "t", cols: "c", rows: "r" },
+});
+
+if (args._.length == 0 || args.help) {
+ console.log(`
+Usage: deno run render_svg.ts USERNAME [options]
+
+ENVIROMENT VARIABLES:
+ GITHUB_TOKEN1: Github Token
+
+
+USERNAME:
+ Github username.
+
+
+Options
+ -f, --file Path to output file (default: ./trophy.svg)
+ -t, --theme Theme-Name (default: default)
+ -c, --cols Colums
+ -r, --rows Rows
+ -h, --help Shows this help
+ `);
-if (!username) {
- console.error(
- "Usage: deno run --allow-net --allow-env --allow-read --allow-write ./render_svg.ts USERNAME [OUTPUT_PATH] [THEME]",
- );
Deno.exit(1);
}
+const [username] = args._ as string[];
+const outputPath = args.file as string;
+const themeName = args.theme as string;
+const cols = parseInt(args.cols as string, 10);
+const rows = parseInt(args.rows as string, 10);
+
+if (Number.isNaN(cols) || Number.isNaN(rows)) {
+ console.error("Cols and Rows need to be Integers!");
+ Deno.exit(2);
+}
+
import { GithubApiService } from "./src/Services/GithubApiService.ts";
import { Card } from "./src/card.ts";
import { COLORS } from "./src/theme.ts";
@@ -37,8 +73,8 @@ async function main() {
const userInfo = userInfoOrError as any;
const panelSize = 115;
- const maxRow = 10;
- const maxColumn = -1; // auto
+ const maxRow = rows;
+ const maxColumn = cols;
const marginWidth = 10;
const marginHeight = 10;
const noBackground = false;
From b528b4e8f3374ebc76fc611484c21199da508704 Mon Sep 17 00:00:00 2001
From: Erik Donath
Date: Thu, 29 Jan 2026 20:23:23 +0100
Subject: [PATCH 09/13] Implement complete argument parsing; Fixed Path
handling using std; Added Token check
---
render_svg.ts | 138 ++++++++++++++++++++++++++++++++------------------
1 file changed, 89 insertions(+), 49 deletions(-)
diff --git a/render_svg.ts b/render_svg.ts
index 7e696072..ca38067e 100644
--- a/render_svg.ts
+++ b/render_svg.ts
@@ -1,64 +1,105 @@
import "https://deno.land/x/dotenv@v0.5.0/load.ts";
import { parseArgs } from "https://deno.land/std@0.208.0/cli/parse_args.ts";
+import { dirname } from "https://deno.land/std/path/mod.ts";
-if(!Deno.env.get("GITHUB_TOKEN1")) {
+import { GithubApiService } from "./src/Services/GithubApiService.ts";
+import { Card } from "./src/card.ts";
+import { COLORS } from "./src/theme.ts";
+
+if (!Deno.env.get("GITHUB_TOKEN1")) {
console.error("Github Token is required!");
+ console.error("Create .env file with: GITHUB_TOKEN1=ghp_xxx");
Deno.exit(1);
}
const args = parseArgs(Deno.args, {
- boolean: ["help"],
- string: ["file", "theme", "cols", "rows"],
- default: { file: "./trophy.svg", theme: "default", cols: "-1", rows: "10" },
- alias: { help: "h", file: "f", theme: "t", cols: "c", rows: "r" },
+ boolean: ["help", "no-background", "no-frame"],
+ string: [
+ "file",
+ "theme",
+ "cols",
+ "rows",
+ "panel-size",
+ "margin-width",
+ "margin-height",
+ ],
+ default: {
+ file: "./trophy.svg",
+ theme: "default",
+ cols: "-1",
+ rows: "10",
+ "panel-size": "115",
+ "margin-width": "10",
+ "margin-height": "10",
+ },
+ alias: {
+ h: "help",
+ f: "file",
+ t: "theme",
+ c: "cols",
+ r: "rows",
+ s: "panel-size",
+ mw: "margin-width",
+ mh: "margin-height",
+ },
});
-if (args._.length == 0 || args.help) {
- console.log(`
-Usage: deno run render_svg.ts USERNAME [options]
-
-ENVIROMENT VARIABLES:
- GITHUB_TOKEN1: Github Token
+if (args.help || args._.length === 0) {
+ console.log(`github-profile-trophy v0.0.0
+Usage: deno run render_svg.ts USERNAME [options]
-USERNAME:
- Github username.
+ENV: GITHUB_TOKEN1=ghp_xxx (required)
+USERNAME: Github username
-Options
- -f, --file Path to output file (default: ./trophy.svg)
- -t, --theme Theme-Name (default: default)
- -c, --cols Colums
- -r, --rows Rows
- -h, --help Shows this help
- `);
+Options:
+ -f, --file FILE Output file (default: ./trophy.svg)
+ -t, --theme THEME Theme name (default: default)
+ -c, --cols N Max Columns (-1=auto, default: -1)
+ -r, --rows N Max Rows (default: 10)
+ -s, --panel-size N Panel size (default: 115)
+ -mw, --margin-width N Margin Width size (default: 10)
+ -mh, --margin-height N Margin Height size (default: 10)
+ --no-background Disable background
+ --no-frame Disable frame
+ -h, --help Show this help`);
- Deno.exit(1);
+ Deno.exit(0);
}
-const [username] = args._ as string[];
-const outputPath = args.file as string;
-const themeName = args.theme as string;
-const cols = parseInt(args.cols as string, 10);
-const rows = parseInt(args.rows as string, 10);
-
-if (Number.isNaN(cols) || Number.isNaN(rows)) {
- console.error("Cols and Rows need to be Integers!");
- Deno.exit(2);
+function parseIntSafe(
+ value: string | undefined,
+ fallback: number,
+ name: string,
+): number {
+ const val = value ?? String(fallback);
+ const num = parseInt(val, 10);
+ if (Number.isNaN(num)) {
+ console.error(`Invalid ${name}: "${val}"; Must be a number!`);
+ Deno.exit(2);
+ }
+ return num;
}
-import { GithubApiService } from "./src/Services/GithubApiService.ts";
-import { Card } from "./src/card.ts";
-import { COLORS } from "./src/theme.ts";
+const [username] = args._ as string[];
+const file = args.file as string;
+const themeName = args.theme as string;
+const maxColumn = parseIntSafe(args.cols, -1, "cols");
+const maxRow = parseIntSafe(args.rows, 10, "rows");
+const panelSize = parseIntSafe(args["panel-size"], 115, "panel-size");
+const marginWidth = parseIntSafe(args["margin-width"], 10, "margin-width");
+const marginHeight = parseIntSafe(args["margin-height"], 10, "margin-height");
+const noBackground = args["no-background"] as boolean;
+const noFrame = args["no-frame"] as boolean;
async function main() {
console.log("Starting trophy render...");
console.log("Username:", username);
- console.log("Output path:", outputPath);
+ console.log("File:", file);
console.log("Theme:", themeName);
const svc = new GithubApiService();
-
const userInfoOrError = await svc.requestUserInfo(username);
if (
@@ -67,19 +108,11 @@ async function main() {
console.error(
"Failed to fetch user info. Check token, username and rate limits.",
);
- Deno.exit(2);
+ Deno.exit(3);
}
const userInfo = userInfoOrError as any;
- const panelSize = 115;
- const maxRow = rows;
- const maxColumn = cols;
- const marginWidth = 10;
- const marginHeight = 10;
- const noBackground = false;
- const noFrame = false;
-
const card = new Card(
[],
[],
@@ -95,15 +128,22 @@ async function main() {
const svg = card.render(userInfo, theme);
try {
- const dir = outputPath.replace(/\/[^/]+$/, "");
- if (dir) await Deno.mkdir(dir, { recursive: true });
+ const dir = dirname(file);
+ if (dir && dir !== ".") {
+ await Deno.mkdir(dir, { recursive: true });
+ }
} catch {
console.error("Failed to create directory. No permission?");
- Deno.exit(3);
+ Deno.exit(4);
}
- await Deno.writeTextFile(outputPath, svg);
- console.log(`Wrote ${outputPath}`);
+ try {
+ await Deno.writeTextFile(file, svg);
+ console.log(`Wrote ${file}`);
+ } catch {
+ console.error("Failed to write file. No permission?")
+ Deno.exit(5);
+ }
}
await main();
From a9c6e4d5a430448f8c8435c586a918962d642110 Mon Sep 17 00:00:00 2001
From: Erik Donath
Date: Thu, 29 Jan 2026 20:36:47 +0100
Subject: [PATCH 10/13] Updated action.yml; Updated README.md quick start
section; Fixed test-repository-action.yml
---
.github/workflows/test-repository-action.yml | 2 +-
README.md | 37 ++++++++++++--
action.yml | 53 ++++++++++++++++++--
3 files changed, 82 insertions(+), 10 deletions(-)
diff --git a/.github/workflows/test-repository-action.yml b/.github/workflows/test-repository-action.yml
index 7fc0a671..3eadc520 100644
--- a/.github/workflows/test-repository-action.yml
+++ b/.github/workflows/test-repository-action.yml
@@ -12,7 +12,7 @@ jobs:
uses: ./.
with:
username: ${{ github.repository_owner }}
- output_path: ./trophy.svg
+ file: ./trophy.svg
token: ${{ secrets.GITHUB_TOKEN }}
- name: Verify SVG generated
diff --git a/README.md b/README.md
index e4bf9158..257fc704 100644
--- a/README.md
+++ b/README.md
@@ -576,9 +576,30 @@ 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 [options]
+
+# Examples:
+deno run --allow-net --allow-env --allow-read --allow-write ./render_svg.ts octocat
+deno run --allow-net --allow-env --allow-read --allow-write ./render_svg.ts octocat -f profile/trophy.svg --theme classic
+deno run --allow-net --allow-env --allow-read --allow-write ./render_svg.ts octocat --no-background --no-frame
+
+# Help:
+deno run --allow-net --allow-env --allow-read --allow-write ./render_svg.ts --help
```
+Options:
+- `-f, --file FILE` Output path (default: `./trophy.svg`)
+- `-t, --theme THEME` Theme name (default: `default`)
+- `-c, --cols N` Max columns (-1=auto, default: `-1`)
+- `-r, --rows N` Max rows (default: `10`)
+- `-s, --panel-size N` Panel size (default: `115`)
+- `-mw, --margin-width N` Margin width (default: `10`)
+- `-mh, --margin-height N` Margin height (default: `10`)
+- `--no-background` Disable background
+- `--no-frame` Disable frame
+- `-h, --help` Show help
+
+
## Generate an svg inside Github CI (Workflow)
Using the provided github action you can easly generate the trophy inside an
@@ -588,12 +609,20 @@ have to manualy update rerun the action to update the file.
Usage:
```yaml
-- name: Generate trophy
+- name: Generate Profile Trophy
uses: Erik-Donath/github-profile-trophy@feature/generate-svg
with:
- username: your-username
- output_path: trophy.svg
token: ${{ secrets.GITHUB_TOKEN }}
+ username: your-username
+ file: trophy.svg
+ theme: classic
+ cols: -1
+ rows: 10
+ panel-size: 115
+ margin-width: 10
+ margin-height: 10
+ no-background: false
+ no-frame: false
```
# Contribution Guide
diff --git a/action.yml b/action.yml
index 7aecc80c..8ae580a8 100644
--- a/action.yml
+++ b/action.yml
@@ -1,16 +1,48 @@
name: Generate GitHub Profile Trophy SVG
description: Run the local generator script to produce an SVG.
inputs:
+ token:
+ description: "PAT or token to use for GitHub API"
+ required: true
username:
description: "GitHub username to generate the trophy for"
required: true
- output_path:
+ file:
description: "Output path to write the SVG"
required: true
default: "trophy.svg"
- token:
- description: "PAT or token to use for GitHub API"
- required: true
+ theme:
+ description: "Theme to use"
+ required: false
+ default: "default"
+ max-cols:
+ description: "Maximum of Cols"
+ required: false
+ default: -1
+ max-rows:
+ description: "Maximum of Rows"
+ required: false
+ default: 10
+ panel-size:
+ description: "Size of the Panel"
+ required: false
+ default: 115
+ margin-width:
+ description: "Margin Width"
+ required: false
+ default: 10
+ margin-height:
+ description: "Margin Height"
+ required: false
+ default: 10
+ no-background:
+ description: "Disable background"
+ required: false
+ default: false
+ no-frame:
+ description: "Disable frame"
+ required: false
+ default: false
runs:
using: "composite"
steps:
@@ -24,4 +56,15 @@ 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 }}"
+ deno run --allow-net --allow-env --allow-read --allow-write \
+ $GITHUB_ACTION_PATH/render_svg.ts \
+ "${{ inputs.username }}" \
+ --file "${{ inputs.file }}" \
+ --theme "${{ inputs.theme }}" \
+ --cols "${{ inputs.cols }}" \
+ --rows "${{ inputs.rows }}" \
+ --panel-size "${{ inputs['panel-size'] }}" \
+ --margin-width "${{ inputs['margin-width'] }}" \
+ --margin-height "${{ inputs['margin-height'] }}" \
+ ${{ inputs['no-background'] && '--no-background' || '' }} \
+ ${{ inputs['no-frame'] && '--no-frame' || '' }}
\ No newline at end of file
From 9848cd2b8c720480223bf8871244051bebdf4cc5 Mon Sep 17 00:00:00 2001
From: Erik Donath
Date: Thu, 29 Jan 2026 20:42:28 +0100
Subject: [PATCH 11/13] deno fmt; fixed action.yml
---
README.md | 6 +-
action.yml | 26 +-
render_svg.ts | 6 +-
trophy.svg | 1681 +++++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 1696 insertions(+), 23 deletions(-)
create mode 100644 trophy.svg
diff --git a/README.md b/README.md
index 257fc704..702ea4a5 100644
--- a/README.md
+++ b/README.md
@@ -53,8 +53,8 @@ These are endpoints provided by volunteers. Please use these in moderation.
by [hongbo-wei](https://github.com/hongbo-wei)
- [https://github-profile-trophy-kannan.vercel.app](https://github-profile-trophy-kannan.vercel.app)
by [kann4n](https://github.com/kann4n)
-- [https://trophy.ryglcloud.net](https://trophy.ryglcloud.net)
- by [PracticalRyan](https://github.com/PracticalRyan)
+- [https://trophy.ryglcloud.net](https://trophy.ryglcloud.net) by
+ [PracticalRyan](https://github.com/PracticalRyan)
# Quick Start
@@ -588,6 +588,7 @@ deno run --allow-net --allow-env --allow-read --allow-write ./render_svg.ts --he
```
Options:
+
- `-f, --file FILE` Output path (default: `./trophy.svg`)
- `-t, --theme THEME` Theme name (default: `default`)
- `-c, --cols N` Max columns (-1=auto, default: `-1`)
@@ -599,7 +600,6 @@ Options:
- `--no-frame` Disable frame
- `-h, --help` Show help
-
## Generate an svg inside Github CI (Workflow)
Using the provided github action you can easly generate the trophy inside an
diff --git a/action.yml b/action.yml
index 8ae580a8..bd9bf5a5 100644
--- a/action.yml
+++ b/action.yml
@@ -14,35 +14,27 @@ inputs:
theme:
description: "Theme to use"
required: false
- default: "default"
max-cols:
description: "Maximum of Cols"
required: false
- default: -1
max-rows:
description: "Maximum of Rows"
required: false
- default: 10
panel-size:
description: "Size of the Panel"
required: false
- default: 115
margin-width:
description: "Margin Width"
required: false
- default: 10
margin-height:
description: "Margin Height"
required: false
- default: 10
no-background:
description: "Disable background"
required: false
- default: false
no-frame:
description: "Disable frame"
required: false
- default: false
runs:
using: "composite"
steps:
@@ -59,12 +51,12 @@ runs:
deno run --allow-net --allow-env --allow-read --allow-write \
$GITHUB_ACTION_PATH/render_svg.ts \
"${{ inputs.username }}" \
- --file "${{ inputs.file }}" \
- --theme "${{ inputs.theme }}" \
- --cols "${{ inputs.cols }}" \
- --rows "${{ inputs.rows }}" \
- --panel-size "${{ inputs['panel-size'] }}" \
- --margin-width "${{ inputs['margin-width'] }}" \
- --margin-height "${{ inputs['margin-height'] }}" \
- ${{ inputs['no-background'] && '--no-background' || '' }} \
- ${{ inputs['no-frame'] && '--no-frame' || '' }}
\ No newline at end of file
+ ${{ inputs.file != '' && format('--file "{0}"', inputs.file) || '' }} \
+ ${{ inputs.theme != 'default' && format('--theme "{0}"', inputs.theme) || '' }} \
+ ${{ inputs.cols != '-1' && format('--cols "{0}"', inputs.cols) || '' }} \
+ ${{ inputs.rows != '10' && format('--rows "{0}"', inputs.rows) || '' }} \
+ ${{ inputs['panel-size'] != '115' && format('--panel-size "{0}"', inputs['panel-size']) || '' }} \
+ ${{ inputs['margin-width'] != '10' && format('--margin-width "{0}"', inputs['margin-width']) || '' }} \
+ ${{ inputs['margin-height'] != '10' && format('--margin-height "{0}"', inputs['margin-height']) || '' }} \
+ ${{ inputs['no-background'] == 'true' && '--no-background' || '' }} \
+ ${{ inputs['no-frame'] == 'true' && '--no-frame' || '' }}
diff --git a/render_svg.ts b/render_svg.ts
index ca38067e..0443b764 100644
--- a/render_svg.ts
+++ b/render_svg.ts
@@ -138,10 +138,10 @@ async function main() {
}
try {
- await Deno.writeTextFile(file, svg);
- console.log(`Wrote ${file}`);
+ await Deno.writeTextFile(file, svg);
+ console.log(`Wrote ${file}`);
} catch {
- console.error("Failed to write file. No permission?")
+ console.error("Failed to write file. No permission?");
Deno.exit(5);
}
}
diff --git a/trophy.svg b/trophy.svg
new file mode 100644
index 00000000..7df1c63b
--- /dev/null
+++ b/trophy.svg
@@ -0,0 +1,1681 @@
+
From deb3ba69ef141fbfca0190d142b96b4869cdf0f5 Mon Sep 17 00:00:00 2001
From: Erik Donath
Date: Thu, 29 Jan 2026 20:43:09 +0100
Subject: [PATCH 12/13] Removed upload
---
trophy.svg | 1681 ----------------------------------------------------
1 file changed, 1681 deletions(-)
delete mode 100644 trophy.svg
diff --git a/trophy.svg b/trophy.svg
deleted file mode 100644
index 7df1c63b..00000000
--- a/trophy.svg
+++ /dev/null
@@ -1,1681 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- S
-
-
- MultiLanguage
- Rainbow Lang User
- 17pt
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- S
-
-
- Joined2020
- Everything started...
- Joined 2020
-
-
-
-
-
-
-
-
-
-
-
-Created by potrace 1.15, written by Peter Selinger 2001-2017
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- A
-
-
-
-
-
-
- A
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- A
-
-
- Stars
- Super Star
- 138pt
-
-
-
-
-
-
-
-
-
-
-
-Created by potrace 1.15, written by Peter Selinger 2001-2017
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- A
-
-
-
-
-
-
- A
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- A
-
-
- Commits
- Ultra Committer
- 739pt
-
-
-
-
-
-
-
-
-
-
-
-Created by potrace 1.15, written by Peter Selinger 2001-2017
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- A
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- A
-
-
- Experience
- Experienced Dev
- 18pt
-
-
-
-
-
-
-
-
-
-
-
-Created by potrace 1.15, written by Peter Selinger 2001-2017
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- A
-
-
- Followers
- Dynamic User
- 20pt
-
-
-
-
-
-
-
-
-
-
-
-Created by potrace 1.15, written by Peter Selinger 2001-2017
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- A
-
-
- Issues
- High Issuer
- 49pt
-
-
-
-
-
-
-
-
-
-
-
-Created by potrace 1.15, written by Peter Selinger 2001-2017
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- A
-
-
- Repositories
- High Repo Creator
- 29pt
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- B
-
-
- PullRequest
- Middle Puller
- 11pt
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- C
-
-
- Reviews
- New Reviewer
- 1pt
-
-
-
-
-
-
From e0a0eedd2fd2222aeab6ece825794f9f40f58333 Mon Sep 17 00:00:00 2001
From: Erik Donath
Date: Thu, 29 Jan 2026 20:48:17 +0100
Subject: [PATCH 13/13] Fixed action.yml
---
action.yml | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/action.yml b/action.yml
index bd9bf5a5..6073b3d4 100644
--- a/action.yml
+++ b/action.yml
@@ -9,8 +9,7 @@ inputs:
required: true
file:
description: "Output path to write the SVG"
- required: true
- default: "trophy.svg"
+ required: false
theme:
description: "Theme to use"
required: false
@@ -52,11 +51,11 @@ runs:
$GITHUB_ACTION_PATH/render_svg.ts \
"${{ inputs.username }}" \
${{ inputs.file != '' && format('--file "{0}"', inputs.file) || '' }} \
- ${{ inputs.theme != 'default' && format('--theme "{0}"', inputs.theme) || '' }} \
- ${{ inputs.cols != '-1' && format('--cols "{0}"', inputs.cols) || '' }} \
- ${{ inputs.rows != '10' && format('--rows "{0}"', inputs.rows) || '' }} \
- ${{ inputs['panel-size'] != '115' && format('--panel-size "{0}"', inputs['panel-size']) || '' }} \
- ${{ inputs['margin-width'] != '10' && format('--margin-width "{0}"', inputs['margin-width']) || '' }} \
- ${{ inputs['margin-height'] != '10' && format('--margin-height "{0}"', inputs['margin-height']) || '' }} \
+ ${{ inputs.theme != '' && format('--theme "{0}"', inputs.theme) || '' }} \
+ ${{ inputs['max-cols'] != '' && format('--cols "{0}"', inputs['max-cols']) || '' }} \
+ ${{ inputs['max-rows'] != '' && format('--rows "{0}"', inputs['max-rows']) || '' }} \
+ ${{ inputs['panel-size'] != '' && format('--panel-size "{0}"', inputs['panel-size']) || '' }} \
+ ${{ inputs['margin-width'] != '' && format('--margin-width "{0}"', inputs['margin-width']) || '' }} \
+ ${{ inputs['margin-height'] != '' && format('--margin-height "{0}"', inputs['margin-height']) || '' }} \
${{ inputs['no-background'] == 'true' && '--no-background' || '' }} \
${{ inputs['no-frame'] == 'true' && '--no-frame' || '' }}