fix(ci): add allow-unsafe-pr-checkout for pull_request_target#33
Open
watney1024 wants to merge 2 commits into
Open
fix(ci): add allow-unsafe-pr-checkout for pull_request_target#33watney1024 wants to merge 2 commits into
watney1024 wants to merge 2 commits into
Conversation
🤖 AI Code Review
📁
|
Replace git diff from fork checkout with gh api to get PR file diffs remotely. This eliminates the need for allow-unsafe-pr-checkout and ref: head.sha entirely. The API handles binary/large file detection automatically via null .patch fields. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
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.
背景
PR #31 将 AI Code Review workflow 的 trigger 从
pull_request改为pull_request_target,使 fork PR 能访问SENSENOVA_API_KEY。但actions/checkout@v4新增了安全保护,默认拒绝在pull_request_target下 checkout fork 代码。变更
在 checkout 步骤添加
allow-unsafe-pr-checkout: true,显式放行。安全说明
此 workflow 对 fork 代码只做只读操作,不存在 "pwn request" 风险:
git difffile -b --mime-encodingcurl→ SenseNova APImake/python/./script.shrun:命令 inline 在 workflow yml 中,fork 无法篡改