feat(action): add title, column, no_frame, no_bg inputs - #1
Conversation
| import "https://deno.land/x/dotenv@v0.5.0/load.ts"; | ||
|
|
||
| const username = Deno.args[0]; | ||
| const outputPath = Deno.args[1] ?? "./assets/trophy.svg"; |
There was a problem hiding this comment.
Done in 9e2f3e5. All arg defaults in render_svg.ts now use CONSTANTS.DEFAULT_* (DEFAULT_MAX_COLUMN, DEFAULT_NO_FRAME, DEFAULT_NO_BACKGROUND), and imports are moved to the top of the file. The action.yml column default is also updated to "8" to match CONSTANTS.DEFAULT_MAX_COLUMN.
There was a problem hiding this comment.
Pull request overview
This PR expands the composite GitHub Action interface so workflows can control more of the trophy card rendering behavior (matching options already supported by the generator/API), by wiring new action.yml inputs through to render_svg.ts and documenting them in the README.
Changes:
- Added
title,column,no_frame, andno_bginputs toaction.ymland passed them as CLI args torender_svg.ts. - Updated
render_svg.tsto parse and apply the new inputs and to useCONSTANTSdefaults (aligning with the API handler). - Updated README usage/examples to include the new optional inputs and updated command usage.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| render_svg.ts | Parses new CLI args (title, column, no_frame, no_bg) and applies CONSTANTS defaults when rendering the SVG. |
| README.md | Documents the updated CLI usage and the new optional action inputs. |
| action.yml | Exposes new inputs and forwards them to the renderer script in the composite action step. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| token: | ||
| description: "PAT or token to use for GitHub API" | ||
| required: true | ||
| default: ${{ github.token }} |
| env: | ||
| GITHUB_TOKEN1: ${{ inputs.token }} | ||
| run: | |
| panelSize, | ||
| marginWidth, | ||
| marginHeight, | ||
| isNaN(maxColumn) ? CONSTANTS.DEFAULT_MAX_COLUMN : maxColumn, |
The GitHub Action only exposed
username,output_path,token, andtheme— leaving most of the card's rendering options inaccessible from workflows.Changes
action.ymltitle,column,no_frame,no_bgrender_svg.tsrender_svg.tstitleas a comma-split string arraycolumnasparseInt(..., 10)(defaults to-1= auto)no_frame/no_bgas booleansCONSTANTSdefaults (consistent with the API handler)Usage