-
Notifications
You must be signed in to change notification settings - Fork 0
Implement graph edges collection support with admin and ingest updates #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: mit-base-salvage
Are you sure you want to change the base?
Changes from all commits
f75b46b
d4be80a
2e59455
881f1f4
7961a72
2476d6c
b43054b
843d79f
2f14eff
a8656de
6cecc26
ec69b2b
ba3d336
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,68 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: Claude Code | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| issue_comment: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| types: [created] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pull_request_review_comment: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| types: [created] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| issues: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| types: [opened] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pull_request_review: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| types: [submitted] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pull_request_target: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| types: [opened, synchronize] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| claude: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # This simplified condition is more robust and correctly checks permissions. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if: > | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| (contains(github.event.comment.body, '@claude') || | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| contains(github.event.review.body, '@claude') || | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| contains(github.event.issue.body, '@claude') || | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| contains(github.event.pull_request.body, '@claude')) && | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| (github.event.sender.type == 'User' && ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| github.event.comment.author_association == 'OWNER' || | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| github.event.comment.author_association == 'MEMBER' || | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| github.event.comment.author_association == 'COLLABORATOR' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| )) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+18
to
+27
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Condition logic is incomplete for The If you intend to support PR-triggered runs, you need to check associations conditionally: 🛠️ Proposed fix to handle different event types if: >
(contains(github.event.comment.body, '@claude') ||
contains(github.event.review.body, '@claude') ||
contains(github.event.issue.body, '@claude') ||
contains(github.event.pull_request.body, '@claude')) &&
- (github.event.sender.type == 'User' && (
- github.event.comment.author_association == 'OWNER' ||
- github.event.comment.author_association == 'MEMBER' ||
- github.event.comment.author_association == 'COLLABORATOR'
+ github.event.sender.type == 'User' && (
+ github.event.comment.author_association == 'OWNER' ||
+ github.event.comment.author_association == 'MEMBER' ||
+ github.event.comment.author_association == 'COLLABORATOR' ||
+ github.event.review.author_association == 'OWNER' ||
+ github.event.review.author_association == 'MEMBER' ||
+ github.event.review.author_association == 'COLLABORATOR' ||
+ github.event.issue.author_association == 'OWNER' ||
+ github.event.issue.author_association == 'MEMBER' ||
+ github.event.issue.author_association == 'COLLABORATOR' ||
+ github.event.pull_request.author_association == 'OWNER' ||
+ github.event.pull_request.author_association == 'MEMBER' ||
+ github.event.pull_request.author_association == 'COLLABORATOR'
- ))
+ )📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| permissions: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # CRITICAL: Write permissions are required for the action to push branches and update issues/PRs. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| contents: write | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pull-requests: write | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| issues: write | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| id-token: write # Required for OIDC token exchange | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| actions: read # Required for Claude to read CI results on PRs | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Checkout repository | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # This correctly checks out the PR's head commit for pull_request_target events. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ref: ${{ github.event.pull_request.head.sha }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Create Claude settings file | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| mkdir -p /home/runner/.claude | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cat > /home/runner/.claude/settings.json << 'EOF' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "env": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "ANTHROPIC_BASE_URL": "https://api.z.ai/api/anthropic", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "ANTHROPIC_AUTH_TOKEN": "${{ secrets.CUSTOM_ENDPOINT_API_KEY }}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| EOF | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Run Claude Code | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| id: claude | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: anthropics/claude-code-action@v1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Still need this to satisfy the action's validation | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| anthropic_api_key: ${{ secrets.CUSTOM_ENDPOINT_API_KEY }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Use the same variable names as your local setup | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| settings: '{"env": {"ANTHROPIC_BASE_URL": "https://api.z.ai/api/anthropic", "ANTHROPIC_AUTH_TOKEN": "${{ secrets.CUSTOM_ENDPOINT_API_KEY }}"}}' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| track_progress: true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| claude_args: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| --allowedTools "Bash,Edit,Read,Write,Glob,Grep" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Critical:
pull_request_targetwith PR head checkout creates a "pwn request" vulnerability.Using
pull_request_targetgrants write permissions and access to secrets, but checking outgithub.event.pull_request.head.sha(the untrusted PR code) allows malicious PRs to execute arbitrary code with those elevated privileges. An attacker could modify workflow files or exfiltrate secrets.Safer alternatives:
pull_requestevent instead (runs in PR context without secrets access)pull_request_targetis required, only checkout the base branch, not the PR head🔒 Recommended fix: Use pull_request event or avoid checking out PR head
Or if you need secrets access, don't checkout PR head:
- name: Checkout repository uses: actions/checkout@v4 - with: - # This correctly checks out the PR's head commit for pull_request_target events. - ref: ${{ github.event.pull_request.head.sha }}Also applies to: 38-42
🤖 Prompt for AI Agents