This content originally appeared on DEV Community and was authored by Helena Archer
Would you like to have a snake eating all your contributions on your GitHub Profile README? Well, thanks to Platane, that is possible!
Check it out
Are you ready?
Step 1: Create your profile README
That would be the README that is shown on your profile link, you create it with a repository with the same name as your GitHub username (including casing). If you wanna know more about it click here.
Step 2: Set up your GitHub Actions
➡️ On your profile repository click on Actions
➡️ Create a new workflow and click on set up a workflow yourself
➡️ Make sure the workflow you are setting up is a yml
file
➡️ On Edit new file
you can paste this and the line github_user_name: [YOUR_USERNAME_HERE]
with your GitHub Username
name: Generate Snake
on:
schedule: # execute every 12 hours
- cron: "* */12 * * *"
workflow_dispatch:
jobs:
build:
name: Update Data
runs-on: ubuntu-latest
steps:
# Snake Animation
- uses: Platane/snk@master
id: snake-gif
with:
github_user_name: [YOUR_USERNAME_HERE]
svg_out_path: dist/github-contribution-grid-snake.svg
- uses: crazy-max/ghaction-github-pages@v2.1.3
with:
target_branch: output
build_dir: dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
➡️ Under Workflows
, you should see the Generate Snake
Action you created. You should have now a green ✅ "build" checkmark. That means your Action is working and you're ready for the next step
Step 3: Add to your README
So there are 2 ways of adding that to your README file. You can either use Markdown or good old HTML
I decided to go for HTML so I could centre the image. That's how it looks on mine:
➡️ Don't forget to change YOUR_USERNAME
for your GitHub Username.
<img src="https://github.com/YOUR_USERNAME/YOUR_USERNAME/blob/output/github-contribution-grid-snake.svg" /></p>
OR
![Snake](https://github.com/YOUR_USERNAME/YOUR_USERNAME/blob/output/github-contribution-grid-snake.svg)
This content originally appeared on DEV Community and was authored by Helena Archer
Helena Archer | Sciencx (2021-08-06T11:22:58+00:00) Simple Guide: How To Set Up A Snake Eating Your Contributions On GitHub. Retrieved from https://www.scien.cx/2021/08/06/simple-guide-how-to-set-up-a-snake-eating-your-contributions-on-github/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.