Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for Action failed with "Cannot read properties of undefined (reading 'split')" #77

Closed
wants to merge 14 commits into from

Conversation

aelassas
Copy link

Now, GitHub client returns the user's contributions as an HTML table, instead of a generated svg. The source code was updated to fix this issue.

snk/svg-only action was updated too.

Here is the working fork: https://github.com/aelassas/snk

You can test it with the following action:

name: snake

on:
  # run automatically every 24 hours
  schedule:
    - cron: "0 */24 * * *" 
  
  # allows to manually run the job at any time
  workflow_dispatch:
  
  # run on every push on the master branch
  push:
    branches:
    - master
    
jobs:
  generate:
    runs-on: ubuntu-latest
    timeout-minutes: 10
    
    steps:
      # generates a snake game from a github user (<github_user_name>) contributions graph, output a svg animation at <svg_out_path>
      - name: generate github-contribution-grid-snake.svg
        uses: aelassas/snk/svg-only@main
        with:
          github_user_name: ${{ github.repository_owner }}
          outputs: |
            dist/github-contribution-grid-snake.svg
            dist/github-contribution-grid-snake-dark.svg?palette=github-dark

      # push the content of <build_dir> to a branch
      # the content will be available at https://raw.githubusercontent.com/<github_user>/<repository>/<target_branch>/<file> , or as github page
      - name: push github-contribution-grid-snake.svg to the output branch
        uses: crazy-max/ghaction-github-pages@v3.1.0
        with:
          target_branch: output
          build_dir: dist
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

@Isabe1le
Copy link

Appears to be working as expected (ref: my profile), should be good to merge.

@milaabl
Copy link

milaabl commented Jul 16, 2023

@aelassas , yup, it's working 🕺👍👍👍My action run: https://github.com/milaabl/milaabl-readme/actions/runs/5566208391

@jjsair0412
Copy link

It's working My README ! Thank you for your help 👍 :)

kouyt5 added a commit to kouyt5/kouyt5 that referenced this pull request Jul 16, 2023
修复无法生成图片bug
@see Platane/snk#77
katzefudder added a commit to katzefudder/katzefudder that referenced this pull request Jul 17, 2023
@Platane
Copy link
Owner

Platane commented Jul 17, 2023

Thanks for looking into that

As @Zxilly pointed in #75 (comment), it will be safer to use the proper github api rather than parsing the dom (which will be subject to change again in the future)

I will push a fix today 👍

Good job on the patch though ( and on deciphering the release steps :D )

@Platane Platane closed this Jul 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants