fix(deno): lock reward script dependencies and narrow run permission#1
Open
luojiyin1987 wants to merge 3 commits into
Open
fix(deno): lock reward script dependencies and narrow run permission#1luojiyin1987 wants to merge 3 commits into
luojiyin1987 wants to merge 3 commits into
Conversation
📝 WalkthroughWalkthroughThis change adds the ChangesFrozen Deno Execution Updates
Estimated code review effort: 1 (Trivial) | ~3 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
本项目主体是 Node/VitePress,Deno lock 仅作用于 GitHub Actions 中的奖励统计脚本。
背景
.github/workflows/statistic-member-reward.yml中的 Deno 脚本通过npm:协议引入了web-utility和zx两个第三方包,但没有锁定依赖版本,且权限过大。问题
npm:web-utility@*和npm:zx@*,存在供应链投毒风险--allow-run(可执行任意命令)和GH_TOKEN(contents: write),一旦被投毒后果严重web-utility@4.6.6因 Parcel 编译产物不兼容 Deno ESM 解析导致脚本报错改动
.github/scripts/count-reward.tsnpm:web-utility@4.6.6/source/date和npm:zx@8.8.5,显式 pin 版本.github/scripts/count-reward.deno.lock.github/workflows/statistic-member-reward.yml--lock=.github/scripts/count-reward.deno.lock --no-config,权限收窄为--allow-run=git,ghdeno.jsondeno.lock.github/scripts/下)后续建议
count-reward.deno.lockweb-utility到非 deprecated 版本