ci(security): resolve all Zizmor audit warnings in dependabot and workflow triggers - #56
Conversation
Reviewer's GuideThe PR reduces automation security findings by adding Dependabot cooldowns, moving eligible workflows from pull_request_target to pull_request with narrower permissions, tightening Dependabot author checks, and updating PR metadata logic to consume Sourcery check results and remove autosubmit when validation is not passing; pinned action SHAs are also refreshed. Sequence diagram for safer pull request metadata validationsequenceDiagram
participant GitHub
participant PRMetadata as PR_Metadata_Workflow
participant ChecksAPI as GitHub_Checks_API
participant LabelsAPI as GitHub_Labels_API
GitHub->>PRMetadata: pull_request event
PRMetadata->>ChecksAPI: checks.listForRef(pr.head.sha)
ChecksAPI-->>PRMetadata: Sourcery check run and CI check runs
PRMetadata->>PRMetadata: evaluate review states and check conclusions
PRMetadata->>LabelsAPI: set status label
alt changes requested, CI failed, or PR blocked
PRMetadata->>LabelsAPI: removeLabel(autosubmit)
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path=".github/workflows/dependabot-auto-merge.yml" line_range="19" />
<code_context>
on:
- pull_request_target:
+ pull_request:
types: [opened, synchronize, reopened]
</code_context>
<issue_to_address>
**issue (broader_impact):** The auto-merge job runs with a read-only `GITHUB_TOKEN` for Dependabot-triggered `pull_request` workflows, so `gh pr merge --auto` cannot enable auto-merge and fails with a permissions error.
**Triggers:** When a Dependabot patch or minor update reaches the auto-merge step.
**Suggested fix:** Use a privileged `workflow_run` follow-up or a GitHub App/PAT with pull-request write access; alternatively retain `pull_request_target` while ensuring the workflow performs no untrusted checkout or execution.
```suggestion
pull_request_target:
```
</issue_to_address>Sourcery assessment
Needs a human reviewer. 1 finding to address first, and this changes the dependency-update policy for every configured ecosystem and moves the auto-merge workflow across a pull-request trust boundary. If either decision is wrong, security updates may be delayed or the workflow may stop receiving the permissions and events it relies on; reverting restores the configuration, but does not recover any exposure or missed updates during the interval.
Blocking findings: .github/workflows/dependabot-auto-merge.yml:19
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
@sourcery-ai review |
|
@sourcery-ai review |
|
@sourcery-ai review |
|
@sourcery-ai review |
There was a problem hiding this comment.
Hey - I've reviewed your changes and they look great!
Sourcery assessment
Needs a human reviewer. The workflow trigger and permission changes alter the GitHub Actions trust boundary, while the PR metadata and auto-merge logic can change labels and merge-related decisions. If incorrect, fork PRs may lose required automation or an unintended PR could be treated as Dependabot-authored; reverting restores future behavior but does not repair decisions or labels already affected.
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Add 7-day cooldown to Dependabot and use safe pull_request trigger to achieve 0 open security findings in Zizmor.
Summary by Sourcery
Harden GitHub Actions and Dependabot configuration to eliminate Zizmor security findings while improving pull request automation safety.
Bug Fixes:
Enhancements:
CI: