CI: drop EOL Node 20, test Node 24; remove long-lived NPM_TOKEN and pin npm in the publish job

未关闭
#56 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
45/100
Issue 类型
重构
描述清晰度
基本清楚
活跃度
活跃
技术栈
github-actions, typescript

调研方向

Start with .github/workflows/ci.yml (the Node matrix near line 15) and .github/workflows/publish.yml, where npm install -g npm@latest is on line 24 and NODE_AUTH_TOKEN is on line 30. Also update engines.node in package.json, plus the Node version mentions in CONTRIBUTING and the README. Done when the matrix is only 22 and 24, engines is >=22, the publish job has no NODE_AUTH_TOKEN, npm is pinned, and actions use commit SHAs. Deleting the secret and changing the npm token setting need a maintainer with repository and npm access.

由索引模型根据 Issue 内容生成。

描述

ci priority: medium security

Why

  • Node 20 reached end of life on 2026-04-30. CI still tests 20 and 22 (.github/workflows/ci.yml:15), engines says >=20.0.0, and CONTRIBUTING says "Node.js 20 or later". Node 24 is the current Active LTS and isn't tested at all, even though it's what new users will install.
  • Release pipeline hygiene (.github/workflows/publish.yml):
    • npm install -g npm@latest (line 24) pulls an unpinned npm into the job that publishes the package.
    • The job sets id-token: write and publishes with --provenance (v0.7.0 notes say trusted publishing was adopted), yet it still passes NODE_AUTH_TOKEN: secrets.NPM_TOKEN (line 30). If trusted publishing is configured, the long-lived token is unnecessary attack surface and should be revoked.
    • Actions are pinned by tag, not commit SHA.

None of this is exploitable today. It's standard supply-chain hardening for a package that holds users' publisher API keys at runtime.

Suggested approach

  1. CI matrix: [22, 24]. Set engines.node to >=22. Update CONTRIBUTING and the README.
  2. Publish: pin npm to an exact version (or use the npm bundled with Node 24). Remove NODE_AUTH_TOKEN, delete the NPM_TOKEN secret, and confirm on npmjs.com that trusted publishing is the only publish path ("disallow tokens" setting).
  3. Pin actions by commit SHA. Dependabot (already set up for actions) keeps the pins current.
  4. Optionally add a workflow_dispatch dry-run of the publish job (npm publish --dry-run) to check releases before tagging.

Done when

CI runs on supported Node versions only, the publish job has no long-lived npm token, and every tool in the release path is pinned.

主要语言
TypeScript
星标
5
派生
2
平均合并
1 小时 32 分钟
30 天内合并 PR
3

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

TMHSDigital/steam-mcp 的其他 Issue

查看 TMHSDigital/steam-mcp 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。