Skip to content
Merged
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
11 changes: 11 additions & 0 deletions .github/workflows/pr-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: AI Code Review

on:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📍 Line 3

name: AI Code Review

👉 on:
  pull_request:
    types: [opened, synchronize, reopened]

jobs:
  call-review:
    uses: ucgmsim/ollama_pr_review/.github/workflows/pr-review.yml@v1.0

⚠️ Problem: For pull requests from forks, GitHub does not pass secrets to workflows triggered by pull_request. This workflow uses a secret, so it will fail or behave unexpectedly for fork PRs, leading to inconsistent CI results.

✅ Fix: Use pull_request_target event (with caution) to allow secret access, or conditionally skip the job for fork PRs. Alternatively, handle the missing secret gracefully in the workflow.

pull_request:
types: [opened, synchronize, reopened]

Comment on lines +3 to +6
jobs:
call-review:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📍 Line 8


on:
  pull_request:
    types: [opened, synchronize, reopened]

jobs:
👉   call-review:
    uses: ucgmsim/ollama_pr_review/.github/workflows/pr-review.yml@v1.0
    secrets:
      OLLAMA_API_KEY: ${{ secrets.OLLAMA_API_KEY }}

⚠️ Problem: Using an external reusable workflow from an untrusted source. If the external repository is compromised, it could execute arbitrary code in the context of this repository, potentially exfiltrating secrets or modifying the codebase.

✅ Fix: Pin the workflow to a specific commit hash instead of a version tag for immutability, and thoroughly audit the external workflow's code. Alternatively, self-host the workflow to maintain control.

uses: ucgmsim/ollama_pr_review/.github/workflows/pr-review.yml@v1.0

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📍 Line 9

on:
  pull_request:
    types: [opened, synchronize, reopened]

jobs:
  call-review:
👉     uses: ucgmsim/ollama_pr_review/.github/workflows/pr-review.yml@v1.0
    secrets:
      OLLAMA_API_KEY: ${{ secrets.OLLAMA_API_KEY }}

⚠️ Problem: Passing a secret to an external reusable workflow exposes the secret to that workflow. If the external workflow is malicious or has a vulnerability, the secret could be leaked or misused.

✅ Fix: Avoid passing secrets to external workflows. If necessary, ensure the external workflow is fully trusted and consider using environment variables with restricted scope.

secrets:
OLLAMA_API_KEY: ${{ secrets.OLLAMA_API_KEY }}
Loading