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

Failure to run action. #63

Closed ghost closed 1 year ago

ghost commented 1 year ago

I thought 4th time would be the charm 😭

As per the marketplace instructions, I clicked 'Use latest version'. Next, I copied the text it told me to, and headed over to my profile repo. I went to Github Actions and clicked "set up a workflow yourself". I dumped the text into the "main.yml" file and committed the changes. I head back to Actions and get this: Screen Shot 2023-01-14 at 7 03 15 PM Screen Shot 2023-01-14 at 7 03 04 PM

Please help! I do feel instructions could be more detailed/clearer, but maybe it's just me :P

ghost commented 1 year ago

And when I figure this out, could someone guide me on getting dark mode? Thanks!

fky2015 commented 1 year ago

This is my GitHub Actions file (And you can see the whole file structures here):

name: generate animation

on:
  # run automatically every day
  schedule:
    - cron: "0 6 * * *" 

  # 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: Platane/snk@v2
        with:
          github_user_name: ${{ github.repository_owner }}
          outputs: |
            dist/github-snake.svg
            dist/github-snake-dark.svg?palette=github-dark
            dist/ocean.gif?color_snake=orange&color_dots=#bfd6f6,#8dbdff,#64a1f4,#4b91f1,#3c7dd9
      # 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@v2.5.0
        with:
          target_branch: output
          build_dir: dist
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

My suggestion is that, to fully understand GitHub Actions, please give a look at the official documentation.

ghost commented 1 year ago

@fky2015 - I’ll try copying that, but ill probably have to change ubuntu because I use macOS, which I believe is darwin?

fky2015 commented 1 year ago

ill probably have to change ubuntu because I use macOS, which I believe is darwin?

There is no need to do that. These actions only run on GitHub servers.

ghost commented 1 year ago

@fky2015 - Copied and pasted your text into my .yml file, manually triggered the workflow run and... image another screenshot: image

ghost commented 1 year ago

If this helps, I downloaded git using the binary installer for macOS. I tried downloading homebrew and stuff but it took way too long on my machine.

Git version: 2.38.1

macOS Monterey 12.6.2 (stopped receiving software updates due to age) MacBook Air (13-inch, Early 2015) Processor: 1.6 GHz Dual-Core Intel Core i5 Memory: 8 GB 1600 MHz DDR3 Graphics: Intel HD Graphics 6000 1536 MB

I've given this info because I did indeed read the error message

fky2015 commented 1 year ago

I think you should allow the force push to your GitHub repo.

Edit: I think this is caused by the lack of write permission to your repo.

ghost commented 1 year ago

I think you should allow the force push to your GitHub repo.

How would I do that?

fky2015 commented 1 year ago

Maybe this would be a help: https://github.com/ad-m/github-push-action/issues/96

ghost commented 1 year ago

Lack of write permission... I'll look at the issue you've linked tomorrow, thank you. Will get back once it works (or fails xD)

EDIT: I'm not sure I want to use the generate-snk anymore, but I want to know the issue and solution (thus I'll look at the issue).

rahulvenugopal commented 1 year ago

I am not 100% sure if this be of any help. I also failed couple of times and finally got this up. https://github.com/rahulvenugopal/github-snake-help

Hope it helps! You can bypass the git pushes and directly do edits in the repo (not recommended, but for the snake it can be done :smile: Cheers to @fky2015 for all the above troubleshootings

ghost commented 1 year ago

@rahulvenugopal - Thanks for the repo! Unfortunately, it didn't help me. I'll try checking this issue that @fky2015 sent me.

ghost commented 1 year ago

OMGOMGOMGOMG IT WORKED YESS.

Ahem. Basically, nothing was wrong. I'd just had "Workflow permissions" set to "Read only". Smart, I know 🙄. But yeah, thanks to literally everyone who spent hours helping me!!!!! @fky2015 @rahulvenugopal