Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
16 changes: 16 additions & 0 deletions .github/workflows/ai-review-approvals.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: AI Review (approvals)

on:
pull_request_review:
types: [submitted, dismissed]

permissions: {}

jobs:
# A review runs the PR's own copy of this workflow, so it only finishes;
# AI Review (human gate) then runs from the default branch.
reviewed:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- run: echo "AI Review (human gate) re-sets ai-review/human."
20 changes: 20 additions & 0 deletions .github/workflows/ai-review-human.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: AI Review (human gate)

on:
workflow_run:
workflows: [AI Review (approvals)]
types: [completed]
pull_request_target:
Comment on lines +4 to +7

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Using unsafe GitHub Actions trigger may allow privilege escalation via CI/CD - medium severity
Using pull_request_target or workflow_run as a trigger is not recommended, as it may allow an attacker to elevate its privileges via the CI/CD pipeline by exfiltrating secrets (e.g. by reading out the caches of the GitHub Actions pipeline or listing loaded secrets in the environment). If the affected repository is open source, the attacker doesn't have to be an insider but could be any GitHub user.

Show fix
Suggested change
workflow_run:
workflows: [AI Review (approvals)]
types: [completed]
pull_request_target:
workflow_run:
workflows: [AI Review (approvals)]
types: [completed]
pull_request:

Reply @AikidoSec ignore: [REASON] to ignore this issue.
More info

branches: [main]
types: [labeled, unlabeled]
Comment thread
aikido-autofix[bot] marked this conversation as resolved.

permissions: {}

jobs:
human-gate:
if: github.event_name == 'workflow_run' || github.event.label.name == 'needs-human-review'
uses: Kong/volcano-actions/.github/workflows/ai-review-human.yml@main
permissions:
contents: read
pull-requests: write
statuses: write
14 changes: 14 additions & 0 deletions .github/workflows/ai-review-merge-queue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: AI Review (merge queue)

on:
merge_group:
branches: [main]
types: [checks_requested]

permissions: {}

jobs:
pass:
uses: Kong/volcano-actions/.github/workflows/ai-review-merge-queue.yml@main
permissions:
statuses: write
20 changes: 20 additions & 0 deletions .github/workflows/ai-review-retarget-override.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: AI Review (retarget and override)

on:
pull_request_target:
branches: [main]
types: [edited, labeled]

permissions: {}

jobs:
retarget-or-override:
if: github.event.changes.base || github.event.label.name == 'ai-review-override'
uses: Kong/volcano-actions/.github/workflows/ai-review.yml@main
permissions:
contents: read
pull-requests: write
statuses: write
secrets:
anthropic_api_key: ${{ secrets.ANTHROPIC_CI_API_KEY }}
openai_api_key: ${{ secrets.OPENAI_CI_API_KEY }}
19 changes: 19 additions & 0 deletions .github/workflows/ai-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: AI Review

on:
pull_request_target:
branches: [main]
types: [opened, synchronize, reopened, ready_for_review]

permissions: {}

jobs:
ai-review:
uses: Kong/volcano-actions/.github/workflows/ai-review.yml@main
permissions:
contents: read
pull-requests: write
statuses: write
secrets:
anthropic_api_key: ${{ secrets.ANTHROPIC_CI_API_KEY }}
openai_api_key: ${{ secrets.OPENAI_CI_API_KEY }}
Loading