Changesets · Branches · Tags · Compare
| Changeset | 688df4862a7f2234aa660502cc5a4e57879e85734ba73c9fda2dc25b68b9a2cb |
|---|---|
| Author | WaylandYang <145302500+WaylandYang@users.noreply.github.com> · 2026-09-02 18:18 +08:00 |
| Committer | GitHub <noreply@github.com> · 2026-09-02 18:18 +08:00 |
| Parents | 98165df18f10 |
3 files changed
modified .github/workflows/ci.yml +6 −0
| @@ -5,6 +5,12 @@ | ||
| 5 | 5 | branches: [main] |
| 6 | 6 | pull_request: |
| 7 | 7 | |
| 8 | +# **显式只读。** 没有这一块时它继承仓库级默认,而那个默认要为 | |
| 9 | +# star-history 改成读写——CI 是每次推送、每个 PR 都跑的那个 workflow, | |
| 10 | +# 不该因为别处的需要顺带拿到写权限。写在这里,仓库默认怎么变都与它无关 | |
| 11 | +permissions: | |
| 12 | + contents: read | |
| 13 | + | |
| 8 | 14 | env: |
| 9 | 15 | CARGO_TERM_COLOR: always |
| 10 | 16 |
modified .github/workflows/star-history.yml +14 −4
| @@ -13,6 +13,9 @@ | ||
| 13 | 13 | jobs: |
| 14 | 14 | star-history: |
| 15 | 15 | runs-on: ubuntu-latest |
| 16 | + # 这个 action 用 Puppeteer 渲染,挂住过。没有这一行的话,挂住就是 | |
| 17 | + # 跑满 GitHub 的六小时上限——实测有一次重试了十五分钟才失败 | |
| 18 | + timeout-minutes: 10 | |
| 16 | 19 | steps: |
| 17 | 20 | - name: Generate Star History |
| 18 | 21 | # 钉到 commit,不是 tag。**这是仓库里第一个有 `contents: write` 的 |
| @@ -26,14 +29,21 @@ | ||
| 26 | 29 | # action 走 GraphQL,而 GitHub 的 fine-grained token 不能用于 |
| 27 | 30 | # GraphQL 认证。试过,报的就是这句话。 |
| 28 | 31 | # |
| 29 | - # 一个 scope 都不用勾——只读公开仓库的星标是公开数据。 | |
| 30 | - # 代价是 classic token 锁不到单个仓库,它是账户级的; | |
| 31 | - # 那正是上面把 action 钉到 commit 的理由:凭据比想要的宽, | |
| 32 | - # 就把代码的来源钉死。 | |
| 32 | + # **需要 `read:org`**(本仓库属于组织,action 要先把 | |
| 33 | + # `deeplethe` 解析成组织),**外加能读星标的权限**:GitHub 在 | |
| 34 | + # 2026-06-30 把星标时间线限制成只有仓库自己的管理员/协作者可读, | |
| 35 | + # 零 scope 的 token 从此读不到,自己的仓库也不行。 | |
| 36 | + # 这条限制也是 star-history.com 那类匿名出图现在只回占位图的原因—— | |
| 37 | + # 换句话说,**用我们自己的 token 在 CI 里出图,是现在唯一还成立的路**。 | |
| 33 | 38 | token: ${{ secrets.METRICS_TOKEN }} |
| 34 | 39 | # 这个不用配:它管的是把生成的 SVG 提交回仓库那一步, |
| 35 | 40 | # 用 workflow 自带的 token,靠上面的 `contents: write` |
| 36 | 41 | committer_token: ${{ github.token }} |
| 42 | + # **提交到专用分支,不碰默认分支。** | |
| 43 | + # `dev` 上有分支保护(必须走 PR、`enforce_admins: true`), | |
| 44 | + # 机器人直推一定被拒;而为了一张图去松保护是本末倒置。 | |
| 45 | + # README 直接引这个分支上的 raw 地址 | |
| 46 | + committer_branch: assets | |
| 37 | 47 | user: ${{ github.repository_owner }} |
| 38 | 48 | repo: ${{ github.event.repository.name }} |
| 39 | 49 | template: repository |
modified README.md +1 −1
| @@ -119,7 +119,7 @@ | ||
| 119 | 119 | |
| 120 | 120 | <div align="center"> |
| 121 | 121 | |
| 122 | -<img src="assets/star-history.svg" alt="Star History" width="820"> | |
| 122 | +<img src="https://raw.githubusercontent.com/deeplethe/utopia/assets/assets/star-history.svg" alt="Star History" width="820"> | |
| 123 | 123 | |
| 124 | 124 | </div> |
| 125 | 125 |