Skip to content

feat(action): add title, column, no_frame, no_bg inputs - #1

Merged
qoomon merged 7 commits into
masterfrom
copilot/adopt-github-action-support-syntax
Jul 20, 2026
Merged

feat(action): add title, column, no_frame, no_bg inputs#1
qoomon merged 7 commits into
masterfrom
copilot/adopt-github-action-support-syntax

Conversation

Copilot AI commented Jul 19, 2026

Copy link
Copy Markdown

The GitHub Action only exposed username, output_path, token, and theme — leaving most of the card's rendering options inaccessible from workflows.

Changes

action.yml

  • Added four optional inputs: title, column, no_frame, no_bg
  • Passes them as positional CLI args to render_svg.ts

render_svg.ts

  • Reads args 3–6 for the new parameters
  • Parses title as a comma-split string array
  • Parses column as parseInt(..., 10) (defaults to -1 = auto)
  • Parses no_frame / no_bg as booleans
  • Replaced hardcoded magic numbers with CONSTANTS defaults (consistent with the API handler)

Usage

- uses: ryo-ma/github-profile-trophy@master
  with:
    username: ${{ github.repository_owner }}
    token: ${{ secrets.GITHUB_TOKEN }}
    title: LongTimeUser
    column: 1
    no_frame: true
    no_bg: true
    theme: ${{ env.LIGHT_TROPHY_THEME }}
    output_path: ./github-profile-trophy/LongTimeUser.svg

Copilot AI requested a review from qoomon July 19, 2026 14:44
Comment thread render_svg.ts
import "https://deno.land/x/dotenv@v0.5.0/load.ts";

const username = Deno.args[0];
const outputPath = Deno.args[1] ?? "./assets/trophy.svg";

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot use CONSTANTS.DEFAULT_* here as well

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot AI requested a review from qoomon July 20, 2026 06:16
@qoomon
qoomon marked this pull request as ready for review July 20, 2026 06:19
Copilot AI review requested due to automatic review settings July 20, 2026 06:19

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, and no_bg inputs to action.yml and passed them as CLI args to render_svg.ts.
  • Updated render_svg.ts to parse and apply the new inputs and to use CONSTANTS defaults (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.

Comment thread action.yml
Comment on lines 11 to +14
token:
description: "PAT or token to use for GitHub API"
required: true
default: ${{ github.token }}
Comment thread action.yml
Comment on lines 45 to 47
env:
GITHUB_TOKEN1: ${{ inputs.token }}
run: |
Comment thread render_svg.ts
panelSize,
marginWidth,
marginHeight,
isNaN(maxColumn) ? CONSTANTS.DEFAULT_MAX_COLUMN : maxColumn,
@qoomon
qoomon merged commit e145593 into master Jul 20, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants