spacehub

surshar / claude-code

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

Built by Anthropic · github.com/anthropics

Merge pull request #6047 from anthropics/boris/adbfBrowse files
Re-add log-issue-events workflow with security fix
Boris Cherny authored on Aug 18, 2025 · GitHub committed on Aug 18, 2025 parents 2558619 + 80ceaca · commit fa29b8f9c092
1 changed file+40 -0compared with 2558619
A.github/workflows/log-issue-events.yml
@@ -1,0 +1,40 @@
1+name: Log Issue Events to Statsig
2+
3+on:
4+ issues:
5+ types: [opened]
6+
7+jobs:
8+ log-to-statsig:
9+ runs-on: ubuntu-latest
10+ permissions:
11+ issues: read
12+ steps:
13+ - name: Log issue creation to Statsig
14+ env:
15+ STATSIG_API_KEY: ${{ secrets.STATSIG_API_KEY }}
16+ ISSUE_NUMBER: ${{ github.event.issue.number }}
17+ REPO: ${{ github.repository }}
18+ ISSUE_TITLE: ${{ github.event.issue.title }}
19+ AUTHOR: ${{ github.event.issue.user.login }}
20+ CREATED_AT: ${{ github.event.issue.created_at }}
21+ run: |
22+ # All values are now safely passed via environment variables
23+ # No direct templating in the shell script to prevent injection attacks
24+
25+ curl -X POST "https://events.statsigapi.net/v1/log_event" \
26+ -H "Content-Type: application/json" \
27+ -H "statsig-api-key: $STATSIG_API_KEY" \
28+ -d '{
29+ "events": [{
30+ "eventName": "github_issue_created",
31+ "metadata": {
32+ "issue_number": "'"$ISSUE_NUMBER"'",
33+ "repository": "'"$REPO"'",
34+ "title": "'"$(echo "$ISSUE_TITLE" | sed "s/\"/\\\\\"/g")"'",
35+ "author": "'"$AUTHOR"'",
36+ "created_at": "'"$CREATED_AT"'"
37+ },
38+ "time": '"$(date +%s)000"'
39+ }]
40+ }'