fix(ci): propagate reusable workflow permissions at caller scope#30
fix(ci): propagate reusable workflow permissions at caller scope#30
Conversation
|
Note Gemini is unable to generate a summary for this pull request due to the file types involved not being currently supported. |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideSets required GitHub token permissions at the workflow (caller) level for the manual review reusable workflows, adds targeted zizmor suppressions to justify these elevated permissions, and removes now-redundant job-level permission blocks so that permissions propagate correctly to the reusable workflows. Sequence diagram for manual review workflow calling reusable workflow with propagated permissionssequenceDiagram
actor Dev as developer
participant GH as github_actions
participant Caller as caller_workflow_manual
participant Reuse as reusable_review_workflow
participant Azure as azure_oidc_target
Dev->>GH: trigger workflow_dispatch
GH->>Caller: start claude-review-manual or opencode-review-manual
Caller->>Caller: apply workflow-level permissions
Caller->>Reuse: call reusable workflow with inherited token
Reuse->>GH: use token with contents read
Reuse->>GH: use token with pull-requests write and issues write
Reuse->>Azure: perform oidc login with id-token write
Reuse-->>GH: complete review jobs
GH-->>Dev: report workflow status
Flow diagram for GitHub Actions permission definition after CI fixflowchart TD
A[Manual dispatch of claude-review-manual or opencode-review-manual] --> B[Evaluate workflow-level permissions]
B --> C{Permissions sufficient
for reusable workflow?}
C -- Yes --> D[Call reusable review workflow
with inherited token]
C -- No (previous behavior) --> E[Startup failure before jobs execute]
D --> F[Reusable workflow performs PR and issue operations]
D --> G[Reusable workflow performs Azure OIDC login]
F --> H[Review jobs complete]
G --> H
H --> I[Workflow succeeds]
subgraph After_Change
B
C
D
F
G
H
I
end
subgraph Before_Change
A
E
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Review Summary by QodoFix permission propagation for reusable review workflows
WalkthroughsDescription• Move permissions from job-level to workflow-level scope • Add zizmor inline suppressions for excessive-permissions warnings • Fix permission propagation for reusable manual review workflows Diagramflowchart LR
A["Job-level permissions"] -->|Move to| B["Workflow-level permissions"]
B -->|Add suppressions| C["zizmor ignore annotations"]
C -->|Enable| D["Reusable workflow access"]
File Changes1. .github/workflows/claude-review-manual.yml
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- Since both workflows now require the same elevated permissions, consider adding a brief shared comment (or central configuration for zizmor) explaining why these scopes are needed instead of repeating inline suppressions on each permission field.
- If
id-token: writeis only needed for Azure OIDC within specific reusable workflow steps, consider whether it can be scoped more narrowly (e.g., only for those workflows or jobs) to reduce the default token surface.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Since both workflows now require the same elevated permissions, consider adding a brief shared comment (or central configuration for zizmor) explaining why these scopes are needed instead of repeating inline suppressions on each permission field.
- If `id-token: write` is only needed for Azure OIDC within specific reusable workflow steps, consider whether it can be scoped more narrowly (e.g., only for those workflows or jobs) to reduce the default token surface.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Code Review by Qodo
1. Workflow-wide elevated perms
|
Summary
zizmorinline suppressions for caller-levelexcessive-permissionsWhy
Manual dispatch runs were failing at startup before jobs executed, indicating permission propagation issues for reusable workflows.
Validation
Summary by Sourcery
CI: