Lazy loaded image
技术分享
🍜GITHUB 插件 - Metircs
Words 645Read Time 2 min
2026-2-12
2026-6-29
type
Post
status
Published
date
Feb 12, 2026
slug
Gplugs
summary
Metric插件原生仓库地址以及配置流程
tags
工具
推荐
category
技术分享
icon
password
类型
日期
标签
概述
状态
进行中

lowlighter/metrics

项目地址

插件部署流程

  1. 前置条件:
      • 需要一个仓库存放生成出来的图片,也就是你的 Profile README 仓库(废话)。
      • 需要一个Token:
        • 只看你自己的公开数据:通常 GITHUB_TOKEN 就够。
        • 要统计 private contributions 或跨组织数据:建议建一个 PAT,并给其最基本的repo + 读取用户数据相关权限。
  1. 流程:
      • 在目标仓库(Profile README 仓库)创建文件:.github/workflows/metrics.yml
        • 内容为:
      • README 里展示:
        • 生成PAT
          • 方法 A (较复杂):
            1. Github 页面右上角头像 → Settings → Developer settings → Personal access tokens → Fine-grained tokens。
            1. 点击 Generate new token
            1. 填写:
              1. Token name:例如 metrics
                Expiration:建议 90 天/1 年(到期要换)
                Resource owner:选择你的账号
                Repository access:选择 Only select repositories → 勾选 Profile README 仓库(如果你希望统计私有仓库贡献,通常还需要让 token 能访问相关私有仓库;这时可以改为 All repositories,或把涉及的私有仓库也选上)。
            1. 在 Permissions 里至少给(常用最小集合):
                • Repository permissions
                  • Contents: Read and write(必须,用来把生成的 metrics-isocalendar.svg 提交回 Profile README 仓库)
                • Account permissions
                  • GitHub profile / Metadata / Read(名称可能略有不同,一般给“读取用户资料/元数据”的权限即可,用于读取你的贡献数据)
            1. 点击 Generate token,复制保存(只显示一次
            然后把它加到 Profile README 仓库 → Settings → Secrets and variables → Actions → New repository secret → METRICS_TOKEN。 方法 B(更简单):
            1. Settings → Developer settings → Personal access tokens → Tokens (classic)
            1. Generate new token (classic)
            1. 勾选 scopes(常用):
                • repo(需要统计私有贡献/访问私有仓库时通常要)
            1. Generate token → 复制保存
            1. 同样存到 METRICS_TOKEN secret
        • 手动运行一次
            1. 打开仓库 Uonlra/Uonlra
            1. 点击顶部 Actions
            1. 左侧找到工作流名称(例如 Metrics)
            1. 点击 Run workflow(通常在右侧/上方)
            1. 选择分支(一般 main)→ 再点 Run workflow
             
        运行完成后你会看到一次 workflow run。点进去能看日志。
        运行完成后会在仓库根目录生成 metrics-isocalendar.svg(并自动 commit 回仓库)。
     
    上一篇
    Git 指令速记
    下一篇
    vibe_coding