Generate a single GitHub-style contribution heatmap SVG and an activity overview SVG from multiple accounts, and keep them up to date with GitHub Actions.
scripts/generate-combined-svg.mjsqueries GitHub's GraphQL API, merges daily contribution counts, and renders two SVGs:combined-contributions.svg(the heatmap) andcombined-activity-overview.svg(the activity overview).github/workflows/update-combined-graph.ymlregenerates the SVGs every day and commits changes back to the repofixtures/mock-contributions.jsongives you a local mock dataset so you can verify the renderer without a live token
- Create a repository and add these files.
- Add a repository variable named
USERSwith a comma-separated list such asaccount1,account2. - The workflow uses GitHub Actions' built-in
GITHUB_TOKEN; only this shared token is used for all accounts. - Run the workflow once with
Actions -> Update Combined Graph -> Run workflow. - Embed the generated SVGs in your profile README:

If you are using this in the same repository where the SVG is generated, you can also use:

Create a local .env file:
USERS=account1,account2
GITHUB_TOKEN=ghp_xxxThen generate the SVGs:
npm run generatenpm run generate now loads .env automatically when the file exists.
Generate with mock data:
npm run verify:mockThe mock command writes sample SVGs to tmp/combined-contributions.svg and tmp/combined-activity-overview.svg.
Run the test suite:
npm testnpm test runs the Node test suite (node --test).
The workflow uses GitHub Actions' built-in GITHUB_TOKEN, and local runs use GITHUB_TOKEN from .env. Only this single shared token is used for all accounts.
When GitHub reports private contributions in the selected window, the activity overview's accessible description notes that GitHub does not break those contributions down into commits, PRs, issues, and reviews.
OUTPUT_FILEchanges the destination heatmap SVG pathTITLEchanges the heading shown inside the heatmap SVGDAYSchanges how many trailing days to include; default is365OVERVIEW_OUTPUT_FILEchanges the destination activity overview SVG pathOVERVIEW_TITLEchanges the heading shown inside the activity overview SVGMAX_REPOSITORIEScaps the number of repositories queried per accountMAX_QUERY_DAYScaps the number of days each GraphQL query window can spanMOCK_DATA_FILEpoints the renderer at a local JSON fixture instead of the live API
The generated SVGs also adapt to light and dark mode automatically with prefers-color-scheme.
GitHub's GraphQL API enforces a shared rate-limit budget (points per hour) across all queries. Each account in USERS adds queries, so a large USERS list can exhaust the GraphQL budget before every account is fetched. To stay within limits, reduce the number of accounts, lower DAYS to shrink the query window, or lower MAX_QUERY_DAYS to keep individual queries small.
- GitHub's native contribution graph cannot be merged across accounts; this generates separate SVGs for display.
- The README images will appear after the first successful workflow run creates
combined-contributions.svgandcombined-activity-overview.svg.