Files
hack/tools/scripts/llm-key-hunter/results/_cache/content/bsampp_gh-actions-lab.json
T

1 line
13 KiB
JSON

{"repo": "bsampp/gh-actions-lab", "files": {".github/workflows/code-review.yml": {"53aa08227bfa2560e181d7680ff454033c85cf45": {"t": 1785747045.9221685, "n": 1088, "h": "507590c549a8272d", "c": "name: Code Review Bot\n\non:\n pull_request:\n types: [opened, synchronize, reopened]\n\njobs:\n review:\n runs-on: ubuntu-latest\n\n steps:\n - name: Checkout code\n uses: actions/checkout@v3\n\n - name: Get code diff\n id: diff\n run: |\n git fetch origin main --unshallow\n git diff origin/main...HEAD --patch --binary --diff-filter=ACMR > diff.patch\n\n - name: Set up Python\n uses: actions/setup-python@v4\n with:\n python-version: 3.11\n\n - name: Install dependencies\n run: pip install requests\n\n - name: Run code review with DeepSeek\n env:\n DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_API_KEY }}\n run: |\n export DIFF=$(cat diff.patch | head -c 6000)\n python .github/scripts/review.py > review_result.txt\n cat review_result.txt\n\n - name: Create comment\n uses: peter-evans/create-or-update-comment@v4\n with:\n issue-number: ${{ github.event.pull_request.number }}\n body-path: review_result.txt\n reactions: '+1'\n"}, "bb61b5697875730cdd2a1789852d34b7e3946693": {"t": 1785769865.6571825, "n": 1052, "h": "3193b9b083bb0a79", "c": "name: Code Review Bot\n\non:\n pull_request:\n types: [opened, synchronize, reopened]\n\njobs:\n review:\n runs-on: ubuntu-latest\n\n steps:\n - name: Checkout code\n uses: actions/checkout@v3\n\n - name: Get code diff\n id: diff\n run: |\n git fetch origin main --unshallow\n git diff origin/main...HEAD > diff.patch\n\n - name: Set up Python\n uses: actions/setup-python@v4\n with:\n python-version: 3.11\n\n - name: Install dependencies\n run: pip install requests\n\n - name: Run code review with DeepSeek\n env:\n DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_API_KEY }}\n run: |\n export DIFF=$(cat diff.patch | head -c 6000)\n python .github/scripts/review.py > review_result.txt\n cat review_result.txt\n\n - name: Create comment\n uses: peter-evans/create-or-update-comment@v4\n with:\n issue-number: ${{ github.event.pull_request.number }}\n body-path: review_result.txt\n reactions: '+1'\n"}, "cf4174d622577c384202403b5c1d5a258b7f3ff8": {"t": 1785769867.1000514, "n": 1405, "h": "cabe93d000a7bc5a", "c": "name: Code Review Bot\n\non:\n pull_request:\n types: [opened, synchronize, reopened]\n\njobs:\n review:\n runs-on: ubuntu-latest\n\n steps:\n - name: Checkout code\n uses: actions/checkout@v3\n\n - name: Get code diff\n id: diff\n run: |\n git fetch origin main --unshallow # Fetch the full history of the main branch\n git diff origin/main...HEAD > diff.patch\n echo \"diff_file=diff.patch\" >> $GITHUB_OUTPUT\n\n - name: Set up Python\n uses: actions/setup-python@v4\n with:\n python-version: 3.11\n\n - name: Install dependencies\n run: pip install requests\n\n - name: Run code review with DeepSeek\n id: review\n env:\n DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_API_KEY }}\n run: |\n export DIFF=$(cat diff.patch | head -c 6000)\n python .github/scripts/review.py > review_result.txt\n cat review_result.txt\n\n - name: Set review output\n id: set_output\n run: |\n echo \"review_text<<EOF\" >> $GITHUB_OUTPUT\n cat review_result.txt >> $GITHUB_OUTPUT\n echo \"EOF\" >> $GITHUB_OUTPUT\n\n - name: Create comment\n uses: peter-evans/create-or-update-comment@v4\n with:\n issue-number: ${{ github.event.pull_request.number }}\n body: ${{ steps.set_output.outputs.review_text }}\n reactions: '+1'\n"}, "3d29ec0c8b5537da9f593ac38cc9b4bbb3e4d7a7": {"t": 1785769868.8031538, "n": 1189, "h": "b060f0154f2e9a6b", "c": "name: Code Review Bot\n\non:\n pull_request:\n types: [opened, synchronize, reopened]\n\njobs:\n review:\n runs-on: ubuntu-latest\n\n steps:\n - name: Checkout code\n uses: actions/checkout@v3\n\n - name: Get code diff\n id: diff\n run: |\n git fetch origin main --unshallow # Fetch the full history of the main branch\n git diff origin/main...HEAD > diff.patch\n echo \"diff_file=diff.patch\" >> $GITHUB_OUTPUT\n\n - name: Set up Python\n uses: actions/setup-python@v4\n with:\n python-version: 3.11\n\n - name: Install dependencies\n run: pip install requests\n\n - name: Run code review with DeepSeek\n id: review\n env:\n DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_API_KEY }}\n run: |\n export DIFF=$(cat diff.patch | head -c 6000)\n python .github/scripts/review.py > review_result.txt\n cat review_result.txt\n\n - name: Create comment\n uses: peter-evans/create-or-update-comment@v4\n with:\n issue-number: ${{ github.event.pull_request.number }}\n body: ${{ steps.review.outputs.review_text }}\n reactions: '+1'\n"}, "d9e8b0ebdd86539bbdf14fb5ff70019c40629bc9": {"t": 1785769871.5707595, "n": 1269, "h": "c5f5d174964a7542", "c": "name: Code Review Bot\n\non:\n pull_request:\n types: [opened, synchronize, reopened]\n\njobs:\n review:\n runs-on: ubuntu-latest\n\n steps:\n - name: Checkout code\n uses: actions/checkout@v3\n\n - name: Get code diff\n id: diff\n run: |\n git fetch origin main --unshallow # Fetch the full history of the main branch\n git checkout -b main origin/main # Ensure main branch exists locally\n git diff origin/main...HEAD > diff.patch\n echo \"diff_file=diff.patch\" >> $GITHUB_OUTPUT\n\n - name: Set up Python\n uses: actions/setup-python@v4\n with:\n python-version: 3.11\n\n - name: Install dependencies\n run: pip install requests\n\n - name: Run code review with DeepSeek\n id: review\n env:\n DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_API_KEY }}\n run: |\n export DIFF=$(cat diff.patch | head -c 6000)\n python .github/scripts/review.py > review_result.txt\n cat review_result.txt\n\n - name: Create comment\n uses: peter-evans/create-or-update-comment@v4\n with:\n issue-number: ${{ github.event.pull_request.number }}\n body: ${{ steps.review.outputs.review_text }}\n reactions: '+1'\n"}, "768a3e607434b48d9897b9e97c8da3b6b6ca2c7c": {"t": 1785769872.9209712, "n": 954, "h": "8977281ca6ee1a34", "c": "name: Code Review Bot\n\non:\n pull_request:\n types: [opened, synchronize, reopened]\n\njobs:\n review:\n runs-on: ubuntu-latest\n\n steps:\n - name: Checkout code\n uses: actions/checkout@v3\n\n - name: Get code diff\n id: diff\n run: |\n git fetch origin main --unshallow # Fetch the full history of the main branch\n git checkout -b main origin/main # Ensure main branch exists locally\n git diff origin/main...HEAD > diff.patch\n echo \"diff_file=diff.patch\" >> $GITHUB_OUTPUT\n\n - name: Set up Python\n uses: actions/setup-python@v4\n with:\n python-version: 3.11\n\n - name: Install dependencies\n run: pip install requests\n\n - name: Run code review with DeepSeek\n env:\n DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_API_KEY }}\n run: |\n export DIFF=$(cat diff.patch | head -c 6000)\n python .github/scripts/review.py\n"}, "8b8044451ba6f55ba5859b08b3da66d9b699d02d": {"t": 1785769874.5974476, "n": 858, "h": "0ac32be2a69534e1", "c": "name: Code Review Bot\n\non:\n pull_request:\n types: [opened, synchronize, reopened]\n\njobs:\n review:\n runs-on: ubuntu-latest\n\n steps:\n - name: Checkout code\n uses: actions/checkout@v3\n\n - name: Get code diff\n id: diff\n run: |\n git fetch origin main # Fetch only the latest commit from main\n git diff origin/main...HEAD > diff.patch\n echo \"diff_file=diff.patch\" >> $GITHUB_OUTPUT\n\n - name: Set up Python\n uses: actions/setup-python@v4\n with:\n python-version: 3.11\n\n - name: Install dependencies\n run: pip install requests\n\n - name: Run code review with DeepSeek\n env:\n DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_API_KEY }}\n run: |\n export DIFF=$(cat diff.patch | head -c 6000)\n python .github/scripts/review.py\n"}, "7b43be33cd3a2f8dc8ced1d327a662ed38697454": {"t": 1785769879.9610245, "n": 869, "h": "65fd0ce61edc0c86", "c": "name: Code Review Bot\n\non:\n pull_request:\n types: [opened, synchronize, reopened]\n\njobs:\n review:\n runs-on: ubuntu-latest\n\n steps:\n - name: Checkout code\n uses: actions/checkout@v3\n\n - name: Get code diff\n id: diff\n run: |\n git fetch origin main --depth=1 # Fetch only the latest commit from main\n git diff origin/main...HEAD > diff.patch\n echo \"diff_file=diff.patch\" >> $GITHUB_OUTPUT\n\n - name: Set up Python\n uses: actions/setup-python@v4\n with:\n python-version: 3.11\n\n - name: Install dependencies\n run: pip install requests\n\n - name: Run code review with DeepSeek\n env:\n DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_API_KEY }}\n run: |\n export DIFF=$(cat diff.patch | head -c 6000)\n python .github/scripts/review.py\n"}, "7085d8b8da3dd4831539812841ae644be0adc1ad": {"t": 1785769883.204965, "n": 817, "h": "22fc167239fc27e4", "c": "name: Code Review Bot\n\non:\n pull_request:\n types: [opened, synchronize, reopened]\n\njobs:\n review:\n runs-on: ubuntu-latest\n\n steps:\n - name: Checkout code\n uses: actions/checkout@v3\n\n - name: Get code diff\n id: diff\n run: |\n git fetch origin main\n git diff origin/main...HEAD > diff.patch\n echo \"diff_file=diff.patch >> $GITHUB_OUTPUT\"\n\n - name: Set up Python\n uses: actions/setup-python@v4\n with:\n python-version: 3.11\n\n - name: Install dependencies\n run: pip install requests\n\n - name: Run code review with DeepSeek\n env:\n DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_API_KEY }}\n run: |\n export DIFF=$(cat diff.patch | head -c 6000)\n python .github/scripts/review.py\n"}}, ".github/scripts/review.py": {"bb61b5697875730cdd2a1789852d34b7e3946693": {"t": 1785769862.143421, "n": 1364, "h": "cfec6ffd62380f69", "c": "import os\nimport requests\nimport json\n\napi_key = os.getenv(\"DEEPSEEK_API_KEY\")\ndiff = os.getenv(\"DIFF\", \"\")[:6000] # limite de segurança\n\nif not diff.strip():\n print(\"No diff to review.\")\n with open(\"review_result.txt\", \"w\") as f:\n f.write(\"Nenhuma alteração relevante encontrada no diff.\")\n exit(0)\n\nprompt = f\"\"\"\nVocê é um revisor de código experiente.\n\nAnalise o seguinte diff de código. Faça comentários objetivos apenas sobre mudanças que realmente impactam o comportamento do código, a clareza ou a manutenção. \n\nNão comente mudanças triviais como renomeações simples ou ajustes cosméticos, a menos que causem erro ou inconsistência. \n\nEvite explicações excessivamente longas. Seja direto, técnico e relevante.\n\n### Diff:\n{diff}\n\"\"\"\n\nresponse = requests.post(\n url=\"https://openrouter.ai/api/v1/chat/completions\",\n headers={\n \"Authorization\": f\"Bearer {api_key}\",\n \"Content-Type\": \"application/json\",\n },\n data=json.dumps({\n \"model\": \"deepseek/deepseek-r1-0528-qwen3-8b:free\",\n \"messages\": [\n {\"role\": \"system\", \"content\": \"Você é um revisor de código.\"},\n {\"role\": \"user\", \"content\": prompt}\n ],\n })\n)\n\nresult = response.json()\nreview = result[\"choices\"][0][\"message\"][\"content\"]\n\nprint(\"\\n--- Code Review Result ---\\n\")\nprint(review)\n\nwith open(\"review_result.txt\", \"w\") as f:\n f.write(review)"}, "7085d8b8da3dd4831539812841ae644be0adc1ad": {"t": 1785769864.4979365, "n": 910, "h": "eaa23ad0d2f8b256", "c": "import os\nimport requests\nimport json\n\napi_key = os.getenv(\"DEEPSEEK_API_KEY\")\ndiff = os.getenv(\"DIFF\", \"\")[:6000] # limite de segurança\n\nif not diff.strip():\n print(\"No diff to review.\")\n exit(0)\n\nprompt = f\"\"\"Você é um revisor de código experiente.\nAnalise o seguinte diff de código, encontre problemas, sugestões de melhoria e boas práticas:\n\n{diff}\n\"\"\"\n\nresponse = requests.post(\n url=\"https://openrouter.ai/api/v1/chat/completions\",\n headers={\n \"Authorization\": f\"Bearer {api_key}\",\n \"Content-Type\": \"application/json\",\n },\n data=json.dumps({\n \"model\": \"deepseek/deepseek-r1-0528-qwen3-8b:free\",\n \"messages\": [\n {\"role\": \"system\", \"content\": \"Você é um revisor de código.\"},\n {\"role\": \"user\", \"content\": prompt}\n ],\n })\n)\n\nresult = response.json()\nreview = result[\"choices\"][0][\"message\"][\"content\"]\n\nprint(\"\\n--- Code Review Result ---\\n\")\nprint(review)\n"}}}}