效果图
这是开发者大佬的github主页
![image-20230516193849346](./../img/post/给你的github个人主页加一个贪吃蛇commit/image-20230516193849346.png)
教程
1.新建一个与你GitHub用户名同名的仓库
此步骤略
2.进入action
![image-20230516194224640](./../img/post/给你的github个人主页加一个贪吃蛇commit/image-20230516194224640.png)
3.新建workflow
![image-20230516194425241](./../img/post/给你的github个人主页加一个贪吃蛇commit/image-20230516194425241.png)
填入你的GitHub用户名
![image-20230516194506566](./../img/post/给你的github个人主页加一个贪吃蛇commit/image-20230516194506566.png)
选择configure
![image-20230516194626301](./../img/post/给你的github个人主页加一个贪吃蛇commit/image-20230516194626301.png)
4.填写代码
你应该会看到这个页面
![image-20230516194755614](./../img/post/给你的github个人主页加一个贪吃蛇commit/image-20230516194755614.png)
去掉原来的所有内容,填入以下内容
# GitHub Action for generating a contribution graph with a snake eating your contributions.
name: Generate Snake
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2.3.4
- name: Generate Snake
uses: Platane/snk@master
id: snake-gif
with:
github_user_name: ${{ github.repository_owner }}
gif_out_path: ./assets/github-contribution-grid-snake.gif
svg_out_path: ./assets/github-contribution-grid-snake.svg
- name: Push to GitHub
uses: EndBug/add-and-commit@v7.2.1
with:
branch: main
message: 'Generate Contribution Snake'
5.运行
![image-20230516195002555](./../img/post/给你的github个人主页加一个贪吃蛇commit/image-20230516195002555.png)
回到action页面,点击运行即可
6.为REDAME.md加上贪吃蛇图片
在你的仓库的REDAME.md文件中加入以下内容
![](https://raw.githubusercontent.com/你的GitHub用户名/你的GitHub用户名/main/assets/github-contribution-grid-snake.svg)
7.成功
![image-20230516195320000](./../img/post/给你的github个人主页加一个贪吃蛇commit/image-20230516195320000.png)
评论