my ✨ github repo
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add GitHub Action to generate contribution snake

This workflow generates a contribution graph visualized as a snake eating contributions and pushes the output to a specified branch.

authored by

Jasper Mayone and committed by
GitHub
c5998abc db29d3d6

+56
+56
.github/workflows/snake.yml
··· 1 + 2 + # GitHub Action for generating a contribution graph with a snake eating your contributions. 3 + name: Generate Snake 4 + 5 + # Controls when the action will run. 6 + on: 7 + schedule: 8 + # every 12 hours 9 + - cron: "0 */12 * * *" 10 + 11 + # This command allows us to run the Action automatically from the Actions tab. 12 + workflow_dispatch: 13 + 14 + # Also run on every push on the main branch 15 + push: 16 + branches: 17 + - main 18 + 19 + permissions: 20 + contents: write 21 + 22 + # The sequence of runs in this workflow: 23 + jobs: 24 + # This workflow contains a single job called "build" 25 + build: 26 + # The type of runner that the job will run on 27 + runs-on: ubuntu-latest 28 + 29 + # Steps represent a sequence of tasks that will be executed as part of the job 30 + steps: 31 + - name: Clone repo 32 + uses: actions/checkout@v3 33 + 34 + - name: Generate the snake files in './dist/' 35 + uses: Platane/snk@v3 36 + id: snake-gif 37 + with: 38 + github_user_name: ${{ github.repository_owner }} 39 + outputs: | 40 + dist/github-contribution-grid-snake.svg 41 + dist/github-contribution-grid-snake-dark.svg?palette=github-dark 42 + dist/github-contribution-grid-snake.gif?color_snake=orange&color_dots=#bfd6f6,#8dbdff,#64a1f4,#4b91f1,#3c7dd9 43 + env: 44 + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 45 + 46 + - name: Show build status 47 + run: git status 48 + 49 + - name: Push new files to the output branch 50 + uses: crazy-max/ghaction-github-pages@v3.1.0 51 + with: 52 + target_branch: snake 53 + build_dir: dist 54 + commit_message: Update snake animations at ${{ github.run_id }} · $(date -u +'%Y-%m-%dT%H:%M:%SZ') 55 + env: 56 + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}