Repository navigation
ci: Run agent 不再注入 GH_TOKEN——评审署名回归 pullfrog[bot] - #137
Conversation
实测对照 panta-log(官方模板原样,评审署名 pullfrog[bot])与本仓库 (评审署名 github-actions[bot]):两仓库同为服务端 dispatch「Review #N」 模式、评审 body 结构完全一致,唯一差异是本仓库给 Run agent 步骤多设了 GH_TOKEN——action 于是用 GITHUB_TOKEN 提交评审,署名落到 github-actions[bot] 头上。删掉该 env,action 走 id-token OIDC 由服务端 以 pullfrog[bot] App 身份提交(Checkout 步骤的 token 不受影响)。 Co-Authored-By: Claude Code <noreply@anthropic.com>
There was a problem hiding this comment.
Caution
Merging this as-is breaks .github/workflows/pullfrog.yml. Removing the step's only env key leaves env: as an empty mapping (YAML null), which GitHub rejects with Invalid workflow file … Unexpected value '' — every auto-review dispatch would fail to parse before the agent even starts.
Reviewed changes
- Dropped
env.GH_TOKENfrom theRun agentstep — relies on the action's OIDC / App-token path so reviews are submitted aspullfrog[bot]; the token-free direction matches Pullfrog's documented model (id-token: write+ ASKPASS git auth), withCheckoutkeeping its ownGH_TOKEN. - Rewrote the header credential note and the step comment — records that
github.tokennow belongs only toCheckoutand warns against re-addingGH_TOKEN.
ℹ️ Header still says reviews post as github-actions[bot]
The file header at lines 5-6 still reads「评审结论以 github-actions[bot] 名义发 review」, which the change itself now contradicts (the new lines 23-24 say the opposite). It is outside every diff hunk, so it is not inline-annotated here — worth fixing in this same doc pass, since the whole point of the header edit is to stop the identity from drifting back.
Technical details
# Stale reviewer-identity sentence in `pullfrog.yml` header
## Affected sites
- `.github/workflows/pullfrog.yml:5-6` —「并自动填好 prompt,评审结论以 github-actions[bot] 名义发 review」describes the pre-change behavior.
## Required outcome
- The header states the reviewer identity this workflow now produces (`pullfrog[bot]`), or drops the identity claim entirely.
## Suggested approach
- Update the sentence to `pullfrog[bot]` and, optionally, cross-reference the step comment at line 85.ℹ️ This PR cannot validate itself via its own auto-review
Pullfrog auto-review dispatches run against the default branch, so the review landing on this PR executes master's pullfrog.yml — the one that still sets GH_TOKEN. The run for this PR (Review #137 [jauax]) is pinned to head_sha 6db7fee on master, confirming the pre-change file is what runs. Expect the auto-review on this PR to stay github-actions[bot] even after this fix; the real check has to happen on a run dispatched after merge.
Technical details
# Verification plan runs the wrong workflow revision
## Affected sites
- PR body "怎么测的" —「本 PR 即验证载体…直接看本 PR 评审的署名」.
- `.github/workflows/pullfrog.yml` is only reachable via `workflow_dispatch`, so a PR merged ref never executes here.
## Evidence
- Workflow-run list: every auto-review run has `head_branch: master`; `Review #137` is at `head_sha 6db7fee` (master, pre-merge).
- `docs.pullfrog.com/pr-reviews.md`: "Pullfrog runs … are dispatched against your default branch — so the workflow run never attaches to the pull request."
## Required outcome
- Verify on a post-merge run: merge, then trigger a review on another PR (or a fresh `workflow_dispatch`) and confirm the review author is `pullfrog[bot]` (compare against #135, authored by `github-actions[bot]`).DeepSeek Flash | 𝕏
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| # 不放 provider key:凭据由 Pullfrog 服务端持有(见文件头「凭据模型」) | ||
| # 不要在这里设 GH_TOKEN(2026-09-26 实测对照 panta-log):设了 action |
There was a problem hiding this comment.
Removing the only key leaves this step's env: with no entries, so the value is YAML null — and GitHub rejects an empty env: mapping with Invalid workflow file … (Line: 84, Col: 9): Unexpected value '', which invalidates the whole workflow. yaml.safe_load returning None confirms the null but not GitHub's grammar; delete the env: key entirely (the comments can move above the step).
Technical details
# Empty `env:` mapping invalidates the workflow
## Affected sites
- `.github/workflows/pullfrog.yml:84` — `env:` has only comment children (lines 85-90), so its value is `null`.
## Evidence
- `actionlint .github/workflows/pullfrog.yml` → `84:13: expecting a single ${{...}} expression or mapping value for "env" section, but found plain text node`.
- GitHub: an empty `env:` block is an invalid workflow file — `Unexpected value ''` (see openvinotoolkit/openvino#37043, which cites the same failure for an empty `env:` at the workflow level; the step-level grammar is identical).
- `yaml.safe_load(open('.github/workflows/pullfrog.yml'))` returns `None` for this step's `env`.
## Required outcome
- The `Run agent` step declares no `env` key at all; `Checkout` keeps its own `GH_TOKEN`.
## Suggested approach
- Delete line 84 and lift the three comments above the `uses:` / `with:` block; no behavior is lost because the step intentionally has no env vars.There was a problem hiding this comment.
Addressed in 2fec60f — the env: key is deleted (comments lifted to step level); actionlint now passes clean.
DeepSeek Flash | 𝕏
第一轮实测(PR #137 自身)署名仍是 github-actions——原因是 workflow_dispatch 的定义取自 master ref,PR 内无法自验证;该轮结果不作数。 本 commit 把 job permissions 收敛为 panta-log 官方模板同款(id-token: write + contents: read):GITHUB_TOKEN 没有评审所需的写权限,action 只能由服务端 以 pullfrog[bot] App 身份提交。与删 GH_TOKEN 形成双保险。 Co-Authored-By: Claude Code <noreply@anthropic.com>
There was a problem hiding this comment.
Caution
The two new commits are correct in direction, but this PR still cannot merge — the previous review's blocker remains unaddressed: env: on the Run agent step (.github/workflows/pullfrog.yml:87) has only comment children, so it parses to YAML null and GitHub rejects the workflow (Invalid workflow file … Unexpected value ''), which fails every auto-review dispatch before the agent starts. The existing thread carries the fix; do not merge until the env: key is deleted.
Reviewed changes
- Trimmed the agent job's
permissionstoid-token: write+contents: read— droppedissues: write/pull-requests: write; verified against Pullfrog's documented contract (docs.pullfrog.com/headless-action, "Required permissions") that the action mints its own App installation tokens via OIDC and needs nothing further fromGITHUB_TOKEN. - Rewrote the header credential note — now names
pullfrog[bot]as the reviewer identity and records that PR-internal auto-review runs executemaster's copy of the workflow, so the identity change is only verifiable post-merge.
DeepSeek Flash | 𝕏
删掉 env: 键(纯注释子节点解析为 null,GitHub 拒载,#137 评审 blocker), GH_TOKEN 禁设说明上移为步骤级注释并补记这个坑。
删掉 env: 键(纯注释子节点解析为 null,GitHub 拒载,#137 评审 blocker), GH_TOKEN 禁设说明上移为步骤级注释并补记这个坑。 Co-Authored-By: Claude Code <noreply@anthropic.com>
469c43b to
2fec60f
Compare
|
blocker 已修(2fec60f): |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Deleted the
env:key from theRun agentstep — the previous review's blocker is fixed: a comment-onlyenv:parsed to YAMLnulland invalidated the whole workflow. The comments are lifted to step level and a note warns against re-creating the pattern. Verified withyaml.safe_load(noenvkey) andactionlint 1.7.7(exit 0, no findings).
DeepSeek Flash | 𝕏
…ev-chat#138) 本 PR 同时是 jev-chat#137 评审署名修复的验证载体:合并后 master 已是收敛版 pullfrog.yml,本 PR 的 Auto-review 评审应署名 pullfrog[bot](而非 github-actions[bot])。 Co-authored-by: Claude Code <noreply@anthropic.com>

为什么改
同是控制台 Auto-review 的 dispatch「Review #N」模式,panta-log(官方模板原样)的评审署名是 pullfrog[bot],本仓库却是 github-actions[bot]。逐项对照后差异有两处,都让 GITHUB_TOKEN 抢走了评审提交权:
Run agent步骤多塞了env.GH_TOKEN: ${{ github.token }}issues: write+pull-requests: write——GITHUB_TOKEN 有评审写权限,action 就自己提交panta-log 官方模板两处都没有:GITHUB_TOKEN 只能读代码,action 无路可走,只能由服务端(OIDC 认证)以 pullfrog[bot] App 身份提交评审。
改了什么
Run agent步骤的env.GH_TOKEN(5ef8609)id-token: write+contents: read,与官方模板一致(e4ee4f3)progress_comments: disabled怎么测的 + 一个机制说明
workflow_dispatch的 workflow 定义取自 dispatch 的 ref(master)——第一轮在 PR #137 自身上的验证不算数(07:37 的评审跑的还是 master 上的旧文件,见 run 36227320805)。所以正确验证流程是:yaml.safe_load已验证:job permissions 仅contents+id-token,Run agent env 无 GH_TOKEN。🤖 Generated with Claude Code