Skip to content

Add GitHub Actions card generation#904

Open
liuchong wants to merge 4 commits into
DenverCoder1:mainfrom
liuchong:main
Open

Add GitHub Actions card generation#904
liuchong wants to merge 4 commits into
DenverCoder1:mainfrom
liuchong:main

Conversation

@liuchong
Copy link
Copy Markdown

Summary

  • Add first-party GitHub Actions support for generating static streak stats SVGs directly from this repository.
  • Reuse the existing PHP stats, cache, and card rendering logic through a small shared generator function and CLI entrypoint.
  • Document how profile repositories can generate and commit profile/streak.svg without depending on the public hosted endpoint.

Test plan

  • Ran npx prettier --check README.md action.yml src/index.php src/generator.php bin/generate-card.php.
  • Verified the action in a profile repository with workflow_dispatch; it generated and committed profile/streak.svg.
  • Confirmed the generated card can be embedded from README via ![GitHub Streak](./profile/streak.svg).

Notes

  • The workflow example uses GITHUB_TOKEN by default.
  • For private contribution data, users should store a PAT in GitHub Secrets and reference it from the token input.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds first-party GitHub Actions support for generating static streak stats SVGs using the existing PHP stats/card pipeline.

Changes:

  • Extracts shared streak-stat generation into src/generator.php and uses it from src/index.php.
  • Adds a CLI entrypoint and composite action.yml for generating SVG output in workflows.
  • Documents profile README workflow usage in README.md.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/index.php Reuses the shared generator for HTTP requests.
src/generator.php Adds reusable stats generation with cache support.
bin/generate-card.php Adds CLI/action entrypoint for parsing options and writing SVG output.
action.yml Defines the composite GitHub Action.
README.md Documents workflow setup and embedding generated SVGs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Owner

@DenverCoder1 DenverCoder1 left a comment

Choose a reason for hiding this comment

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

I love this approach! Thanks so much for the contribution!

This should reduce a lot of the server error complaints since it does not rely on Heroku's availability.

Comment thread README.md
Comment thread README.md
liuchong and others added 2 commits June 1, 2026 12:39
@liuchong
Copy link
Copy Markdown
Author

liuchong commented Jun 1, 2026

All review feedback has been addressed. The workflow trigger suggestion was added, and the README now includes a dedicated section showing how to embed the generated static SVG in a profile README.
Please check again 👀

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