#代码展示

name: generate animation

permissions:
  contents: write

on:
  schedule:
    - cron: "0 2 * * *"

  workflow_dispatch:

  push:
    branches:
      - main

jobs:
  generate:
    runs-on: ubuntu-latest
    timeout-minutes: 10

    steps:
      - uses: actions/checkout@v4
      
      - name: generate github-contribution-grid-snake.svg
        uses: Platane/snk/svg-only@v3
        with:
          github_user_name: ${{ github.repository_owner }}
          outputs: |
            ./static/svg/snake-Light.svg
            ./static/svg/snake-Dark.svg
            
      - name: Push to GitHub
        uses: EndBug/add-and-commit@v9.1.4
        with:
          message: 'Generate Contribution Snake'      
          add: '*.svg --force'

修改代码

注意,./static/svg/snake-Light.svg以及./static/svg/snake-Dark.svg应当被修改为您的目录。

成果展示