Skip to content
Merged
Show file tree
Hide file tree
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
92 changes: 0 additions & 92 deletions .github/workflows/ai-on-demand.yaml

This file was deleted.

30 changes: 30 additions & 0 deletions .github/workflows/ai-on-demand.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: AI On-Demand Assistant
on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
pull_request_review:
types: [submitted]
issues:
types: [opened]

permissions:
contents: read
issues: write
pull-requests: write
actions: read

jobs:
ai-response:
uses: ethereumfollowprotocol/workflow-automation/.github/workflows/issue-response.yml@v1.0.9
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Pin reusable workflow to a commit SHA to prevent tag hijack.

-    uses: ethereumfollowprotocol/workflow-automation/.github/workflows/issue-response.yml@v1.0.9
+    # Pin to exact commit for supply-chain safety (v1.0.9)
+    uses: ethereumfollowprotocol/workflow-automation/.github/workflows/issue-response.yml@<commit-sha>
🤖 Prompt for AI Agents
.github/workflows/ai-on-demand.yml line 20: the reusable workflow reference
currently uses a tag (@v1.0.9) which can be hijacked; replace the tag with the
exact commit SHA for ethereumfollowprotocol/workflow-automation that corresponds
to v1.0.9 (find the tag’s commit SHA in that repo and update the line to use
@<COMMIT_SHA>), commit the change, and verify the workflow runs successfully.

with:
config-profile: "default"
bot-mention: "@efp-dev-ops"
enable-auto-labeling: true
enable-escalation: true
secrets:
CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.DEV_OPS_BOT_CLAUDE_CODE_OAUTH_TOKEN }}
APP_ID: ${{ secrets.DEV_OPS_BOT_APP_ID }}
PRIVATE_KEY: ${{ secrets.DEV_OPS_BOT_PRIVATE_KEY }}
ALLOWED_USER_LIST: ${{ secrets.DEV_OPS_BOT_ALLOWED_USER_LIST }}
77 changes: 0 additions & 77 deletions .github/workflows/ai-review.yaml

This file was deleted.

21 changes: 21 additions & 0 deletions .github/workflows/ai-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: AI Code Review
on:
pull_request:
types: [opened, synchronize, reopened]

Comment on lines +2 to +5
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

PRs from forks won’t have access to secrets; guard or switch event.

Either gate the job to skip forks, or carefully switch to pull_request_target (with safe checkout in the called workflow).

Option A — gate forks:

 jobs:
   ai-review:
+    if: ${{ github.event.pull_request.head.repo.fork == false }}

Option B — use pull_request_target:

-on:
-  pull_request:
-    types: [opened, synchronize, reopened]
+on:
+  pull_request_target:
+    types: [opened, synchronize, reopened]

Confirm the reusable workflow safely checks out the base ref to avoid running untrusted code.


🏁 Script executed:

#!/bin/bash
set -e

file=".github/workflows/ai-review.yml"
if [ -f "$file" ]; then
  echo "=== First 200 lines of $file ==="
  sed -n '1,200p' "$file"
  echo
  echo "=== Secret usage in $file ==="
  grep -n "secrets\." "$file" || echo "No secrets usage found"
else
  echo "File not found: $file"
  exit 1
fi

Length of output: 1314


Gate forks or switch to pull_request_target for secret access
This job uses repository secrets (e.g. DEV_OPS_BOT_CLAUDE_CODE_OAUTH_TOKEN), which aren’t available to pull_request events from forks. Either restrict it to non-forks:

 jobs:
   ai-review:
+    if: ${{ github.event.pull_request.head.repo.fork == false }}

or switch the trigger to pull_request_target (and ensure the reusable workflow’s checkout step uses the base ref):

-on:
-  pull_request:
-    types: [opened, synchronize, reopened]
+on:
+  pull_request_target:
+    types: [opened, synchronize, reopened]
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
on:
pull_request:
types: [opened, synchronize, reopened]
on:
pull_request_target:
types: [opened, synchronize, reopened]

permissions:
contents: read
pull-requests: write
issues: write
actions: read

jobs:
ai-review:
uses: ethereumfollowprotocol/workflow-automation/.github/workflows/pr-review.yml@v1.0.9
with:
config-profile: "default"
secrets:
CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.DEV_OPS_BOT_CLAUDE_CODE_OAUTH_TOKEN }}
APP_ID: ${{ secrets.DEV_OPS_BOT_APP_ID }}
PRIVATE_KEY: ${{ secrets.DEV_OPS_BOT_PRIVATE_KEY }}
ALLOWED_USER_LIST: ${{ secrets.DEV_OPS_BOT_ALLOWED_USER_LIST }}
Loading