Skip to content

Starcharts Action

Actions
Plot your repository stars over time
v2.0.1
Latest
Star (23)

Tags

 (1)

Starcharts Action

灵感来自 caarlos0/starcharts,用 Actions 避免了 GitHub API 的速率限制

入参

参数 描述 是否必传 默认值
github_token 用于提交时身份验证的 token
svg_path 星图的保存路径 "STARCHARTS.svg"
commit_message 提交信息 "chore: update starcharts [skip ci]"
stars_change 更新至少需要的 stars 数变化值 "1"
repo 生成其他仓库的星图 ""

示例

新建 .github/workflows/starcharts.yml,内容如下:

name: Starcharts

on:
  schedule:
    - cron: "0 0 * * 0"
  workflow_dispatch:

jobs:
  starcharts:
    name: Generate starcharts
    runs-on: ubuntu-latest
    steps:
      - uses: MaoLongLong/actions-starcharts@main
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          # 自定义 token 减少被限流的可能
          # github_token: ${{ secrets.GH_TOKEN }}
          svg_path: images/starcharts.svg
          # stars_change: "100"
          # repo: "doocs/advanced-java"

效果

doocs/advanced-java Stars 趋势

doocs/leetcode Stars 趋势(2021-09-30 生成)

TODO

  • 修复由于 GitHub V3 API 分页限制,无法获取 40K stars 以上数据的问题
  • 部分操作仍然依赖 GitHub API V3,打算全部替换为 V4 还是 v3 用的顺手点,所以暂时就 getStargazers() 用的 v4
  • 由于 Actions 中调用 V4 API 有 1000 的次数限制,所以它暂时只支持到 100K stars 的仓库自定义 token解决
  • 为了文明使用 GitHub API,暂时没有使用多 goroutine,所以生成速度较慢

Starcharts Action is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Plot your repository stars over time
v2.0.1
Latest

Tags

 (1)

Starcharts Action is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.