前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >给你的github个人主页加一个贪吃蛇commit

给你的github个人主页加一个贪吃蛇commit

作者头像
金鳞星溅
发布2023-05-18 10:03:25
6420
发布2023-05-18 10:03:25
举报

效果图

这是开发者大佬的github主页

image-20230516193849346
image-20230516193849346

教程

1.新建一个与你GitHub用户名同名的仓库

此步骤略

2.进入action

image-20230516194224640
image-20230516194224640

3.新建workflow

image-20230516194425241
image-20230516194425241

填入你的GitHub用户名

image-20230516194506566
image-20230516194506566

选择configure

image-20230516194626301
image-20230516194626301

4.填写代码

你应该会看到这个页面

image-20230516194755614
image-20230516194755614

去掉原来的所有内容,填入以下内容

代码语言:javascript
复制
# 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'
image-20230516194917314
image-20230516194917314

5.运行

image-20230516195002555
image-20230516195002555

回到action页面,点击运行即可

6.为REDAME.md加上贪吃蛇图片

在你的仓库的REDAME.md文件中加入以下内容

代码语言:javascript
复制
![](https://raw.githubusercontent.com/你的GitHub用户名/你的GitHub用户名/main/assets/github-contribution-grid-snake.svg)

7.成功

image-20230516195320000
image-20230516195320000
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2023-05-16,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 效果图
  • 教程
    • 1.新建一个与你GitHub用户名同名的仓库
      • 2.进入action
        • 3.新建workflow
          • 4.填写代码
          • 5.运行
          • 6.为REDAME.md加上贪吃蛇图片
          • 7.成功
          领券
          问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档