How to Add a Snake Animation to Your GitHub Contributions
The GitHub “snake” graphic is a simple way to visualize your contribution graph. You can generate it automatically with a GitHub Action and publish it as SVG/GIF.
What you need
- A public repository for workflow automation.
- GitHub Actions enabled.
- A profile README (
username/usernamerepository) if you want to display it on your profile.
1) Add the workflow
Create .github/workflows/snake.yml:
name: Generate Snake
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: Platane/snk/svg-only@v3
with:
github_user_name: naveenkhn
outputs: |
dist/github-contribution-grid-snake.svg
dist/github-contribution-grid-snake-dark.svg?palette=github-dark
- name: Push generated files
uses: crazy-max/ghaction-github-pages@v4
with:
target_branch: output
build_dir: dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Replace naveenkhn with your GitHub username.
2) Reference the generated image
After workflow runs, use this in your README:

For dark mode:

3) Keep it reliable
- Use
workflow_dispatchfor manual reruns. - Keep schedule daily to avoid noisy commits.
- Confirm repository is public if you want raw GitHub URLs to render everywhere.
The result is an auto-updating visual badge that makes your activity section more interactive without manual effort.