Skip to content

Generate Snake

Generate Snake #13

Workflow file for this run

# GitHub Action for generating a contribution graph with a snake eating your contributions.
name: Generate Snake
# Controls when the action will run. This action runs every 6 hours.
on:
schedule:
# every 6 hours
- cron: "*/60 * * * *"
# This command allows us to run the Action automatically from the Actions tab.
workflow_dispatch:
# The sequence of runs in this workflow:
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks repo under $GITHUB_WORKSHOP, so your job can access it
- uses: actions/checkout@v3
# Generates the snake
- uses: Platane/snk@v2
with:
# github user name to read the contribution graph from (**required**)
# using action context var `github.repository_owner` or specified user
github_user_name: ${{ github.repository_owner }}
# list of files to generate.
# one file per line. Each output can be customized with options as query string.
#
# supported options:
# - palette: A preset of color, one of [github, github-dark, github-light]
# - color_snake: Color of the snake
# - color_dots: Coma separated list of dots color.
# The first one is 0 contribution, then it goes from the low contribution to the highest.
# Exactly 5 colors are expected.
outputs: |
dist/github-snake-dark-neon-1.svg?palette=github-dark&color_snake=#95E0DC&color_dots=#161B22,#b20148,#e4015d,#fe1b77,#fe4d95
dist/github-snake-dark-neon-2.svg?palette=github-dark&color_snake=#FE428E&color_dots=#161B22,#017e74,#02b0a2,#03e3d0,#4ffdef
# show the status of the build. Makes it easier for debugging (if there's any issues).
- run: git status
# Push the changes
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: master
force: true
- uses: crazy-max/ghaction-github-pages@v3
with:
# the output branch we mentioned above
target_branch: output
build_dir: dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}