Skip to content

Add GitHub Actions card generation#904

Merged
DenverCoder1 merged 6 commits into
DenverCoder1:mainfrom
liuchong:main
Jun 2, 2026
Merged

Add GitHub Actions card generation#904
DenverCoder1 merged 6 commits into
DenverCoder1:mainfrom
liuchong:main

Conversation

@liuchong

Copy link
Copy Markdown
Contributor

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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.

@DenverCoder1 DenverCoder1 left a comment

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.

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 Outdated
Comment thread README.md Outdated
liuchong and others added 2 commits June 1, 2026 12:39
@liuchong

liuchong commented Jun 1, 2026

Copy link
Copy Markdown
Contributor Author

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 👀

@DenverCoder1 DenverCoder1 left a comment

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.

Thank you for contributing!

Next we should update the demo site to support generating a customized workflow file, but that can be saved for another PR

@DenverCoder1
DenverCoder1 merged commit 0ef785c into DenverCoder1:main Jun 2, 2026
4 checks 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