Skip to content

feat: add support for calendar year selection and date ranges - #205

Open
jjceron wants to merge 2 commits into
Platane:mainfrom
jjceron:feature/year-range
Open

feat: add support for calendar year selection and date ranges#205
jjceron wants to merge 2 commits into
Platane:mainfrom
jjceron:feature/year-range

Conversation

@jjceron

@jjceron jjceron commented Jul 8, 2026

Copy link
Copy Markdown

Overview

This PR introduces the capability to generate the contribution snake animation for a specific calendar year or a custom date range, rather than being restricted strictly to the last 365 rolling days.

To achieve this flexibility and allow custom runtime execution/compilation via tools like Bun/Yarn inside workflows, the action execution environment has also been migrated from a locked Docker container to a native Node.js setup.


Detailed Changes per File

  • action.yml

    • Added new optional inputs: year, from, and to.
    • Migrated the execution engine (runs) from docker to node20 pointing to the compiled distribution path (packages/action/dist/index.js).
  • packages/action/index.ts

    • Implemented input extraction for year, from, and to using the GitHub Actions core library.
    • Added parsing logic to cast the year string into a valid number (Number(year)) before passing it downstream.
  • packages/generate-snake-animation/cli.ts

    • Updated the Command Line Interface (CLI) configuration to properly accept and route the new date-filtering arguments during local execution or debugging.
  • packages/generate-snake-animation/generateSnakeAnimation.ts

    • Updated the animation orchestrator function signature and execution block to forward the time-frame constraints into the data-fetching layer.
  • packages/github-user-contribution/index.ts

    • Modified the internal GraphQL/API query mechanism that communicates with GitHub's servers to fetch explicit historical data scoped to the selected year/range instead of the generic contribution calendar.

How to use this new integration

In your profile workflow .yml, clone this custom action branch and pass the year parameter like this:

- name: Generate Animated Snake
  uses: ./.github/actions/snk-custom # Points to your built local copy of this fork
  with:
    github_user_name: jjceron
    outputs: |
      dist/github-contribution-grid-snake-dark.svg?palette=github-dark
    year: 2026 # Target year configuration

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.

1 participant