Platane / snk

🟩⬜ Generates a snake game from a github user contributions graph and output a screen capture as animated svg or gif
https://platane.github.io/snk
4.39k stars 1.11k forks source link

Error: Action failed with "Cannot read properties of null (reading '1')" #55

Closed Life4gal closed 1 year ago

Life4gal commented 1 year ago

The workflow I used in the beginning was like this:

name: github-contribution-grid-snake

on:
    schedule:
        - cron: "0 */12 * * *"
    push:
        branches: [ main ]
    workflow_dispatch:

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

        steps:
            - name: generate animation.svg
              uses: Platane/snk@master
              with:
                  github_user_name: ${{ github.repository_owner }}
                  svg_out_path: dist/github-contribution-grid-snake.svg

            - name: push github-contribution-grid-snake.svg to the snake_branch branch
              uses: crazy-max/ghaction-github-pages@v3
              with:
                  target_branch: snake_branch
                  build_dir: dist
              env:
                  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

It works fine, there is only one problem... image

I didn't like the warning, so I tried to fix it. I noticed that the version I was using was Platane/snk@master, so I came here to try to find a more recent (Release) version, and I saw that the most recent Release was v2.1.0, so I changed the workflow to that:

name: github-contribution-grid-snake

on:
    schedule:
        - cron: "0 0 * * *"
    push:
        branches: [ main ]
    workflow_dispatch:

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

        steps:
            - name: generate animation.svg
              uses: Platane/snk@v2.1.0
              with:
                  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-contribution-grid-snake.svg
                    dist/github-contribution-grid-snake-dark.svg?palette=github-dark
                    dist/github-contribution-grid-snake-ocean.gif?color_snake=orange&color_dots=#bfd6f6,#8dbdff,#64a1f4,#4b91f1,#3c7dd9

            - name: push github-contribution-grid-snake.svg to the snake_branch branch
              uses: crazy-max/ghaction-github-pages@v3
              with:
                  target_branch: snake_branch
                  build_dir: dist
              env:
                  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Then it doesn't work and generates an error. image

I noticed that a similar question was raised earlier in #35, but that's obviously a different question from mine.

askiiart commented 1 year ago

It's even happening in Platane's own repo!. It appears to be a very new bug, maybe something about a new Ubuntu update, since we're all using ubuntu-latest?

Take anything I saw with a huge grain of salt, BTW. I know very little about this stuff.

Update: Nope, I just tried ubuntu-20.04. Still doesn't work. Maybe some other dependency broke it?

migueltc13 commented 1 year ago

@askiiart It's a dependency issue most certainly.

Current status:

generate animation

sryu1 commented 1 year ago

Yeah, I'm getting that issue as well

NotADinosaur commented 1 year ago

I also have the same issue.

Life4gal commented 1 year ago

It looks like v2.2.0 fixes this issue. :)

Platane commented 1 year ago

Same issue as #54

thanks for reporting, it's fixed :+1:

Platane commented 1 year ago

@askiiart It's a dependency issue most certainly.

Current status:

generate animation

The badge is a good idea, I am going to add it to the readme :+1: