Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/glm-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: GLM Review
on:
pull_request:
types: [opened, synchronize]
paths-ignore:
- "**/*.md"
- ".gitignore"

jobs:
review:
# Only review substantial changes (5+ files, or 20+ additions, or 20+ deletions)
if: |
github.event.pull_request.changed_files >= 5 ||
github.event.pull_request.additions >= 20 ||
github.event.pull_request.deletions >= 20
uses: frankbria/glm-review/.github/workflows/review.yml@main

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[major] The reusable workflow is pinned to the floating @main ref, so any commit pushed to frankbria/glm-review — accidental or malicious — silently changes the code this job executes, and it runs with pull-requests: write + issues: write on this repo.

Failure scenario: a compromised token or a bad push to glm-review's main rewrites the reviewer logic; the next PR here runs attacker-controlled code that can post/modify PR comments and issues, with no SHA gate at the caller side. This repo's own stated policy is to SHA-pin actions/workflows (CLAUDE.md: "actions are SHA-pinned and Dependabot keeps the pins fresh"; security-audit.yml is blocking), so this is the one footgun it already mitigates elsewhere.

Suggested change
uses: frankbria/glm-review/.github/workflows/review.yml@main
uses: frankbria/glm-review/.github/workflows/review.yml@<40-char-commit-sha> # pin to a verified SHA, e.g. @abcd1234… # v1.0.0

Replace <40-char-commit-sha> with the full SHA of the commit you verified on hai-sh#75; Dependabot can bump it.

permissions:
contents: read
pull-requests: write
issues: write
id-token: write

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[minor] id-token: write lets the called workflow mint OIDC tokens, which a PR reviewer has no obvious need for — it only widens the blast radius of the unpinned @main reference above.

Failure scenario: combined with the floating @main ref, a malicious reviewer revision could mint OIDC tokens and attempt to assume any cloud role this repo is trusted for (if OIDC cloud trusts are ever added). Drop it unless the glm-review workflow actually calls actions/core OIDC / requestToken.

Suggested change
id-token: write

(This deletes the id-token: write line — keep it only if the called workflow requires OIDC.)

secrets:
ZHIPU_API_KEY: ${{ secrets.ZHIPU_API_KEY }}