@@ -155,7 +155,41 @@ jobs:
155155 echo "=== Fuzzer log preview (last 100 lines, where crashes are reported) ==="
156156 tail -100 logs/fuzz_output.log || echo "No log file"
157157
158+ - name : Setup Python
159+ uses : actions/setup-python@v5
160+ with :
161+ python-version : ' 3.11'
162+
163+ - name : Install dependencies
164+ run : pip install anthropic
165+
166+ - name : Check for duplicate issue
167+ id : dedup
168+ env :
169+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
170+ ANTHROPIC_API_KEY : ${{ secrets.ANTHROPIC_API_KEY }}
171+ run : |
172+ python scripts/check_fuzzer_duplicate.py \
173+ "${{ needs.io_fuzz.outputs.first_crash_name }}" \
174+ "logs/fuzz_output.log" \
175+ "${{ github.repository }}" > dedup_result.json
176+
177+ # Check exit code (0 = not duplicate, 1 = duplicate)
178+ if [ $? -eq 0 ]; then
179+ echo "is_duplicate=false" >> $GITHUB_OUTPUT
180+ echo "Not a duplicate, will create new issue"
181+ else
182+ echo "is_duplicate=true" >> $GITHUB_OUTPUT
183+ ISSUE_NUM=$(jq -r '.issue_number' dedup_result.json)
184+ echo "issue_number=$ISSUE_NUM" >> $GITHUB_OUTPUT
185+ echo "Duplicate of issue #$ISSUE_NUM"
186+ fi
187+
188+ # Show result
189+ cat dedup_result.json
190+
158191 - name : Create GitHub issue
192+ if : 0 && steps.dedup.outputs.is_duplicate == 'false'
159193 env :
160194 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
161195 run : |
@@ -257,6 +291,37 @@ jobs:
257291 *Run: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}*
258292 EOF
259293
294+ - name : Comment on duplicate issue
295+ if : steps.dedup.outputs.is_duplicate == 'true'
296+ env :
297+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
298+ run : |
299+ ISSUE_NUM="${{ steps.dedup.outputs.issue_number }}"
300+
301+ gh issue comment "$ISSUE_NUM" \
302+ --repo ${{ github.repository }} \
303+ --body-file - <<'EOF'
304+ ## Additional Crash Detected
305+
306+ Another crash was found in the `file_io` fuzzing target that appears to be a duplicate of this issue.
307+
308+ ### Details
309+
310+ - **Crash File**: `${{ needs.io_fuzz.outputs.first_crash_name }}`
311+ - **Total Crashes**: ${{ needs.io_fuzz.outputs.crash_count }} found in this run
312+ - **Workflow Run**: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
313+ - **Timestamp**: $(date -u +"%Y-%m-%d %H:%M:%S UTC")
314+
315+ ### Artifacts
316+
317+ Download crash artifacts from: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
318+
319+ The fuzzing infrastructure detected this as a likely duplicate based on similar stack traces and error messages.
320+
321+ ---
322+ *Automatically added by fuzzing workflow*
323+ EOF
324+
260325 ops_fuzz :
261326 name : " Array Operations Fuzz"
262327 timeout-minutes : 230 # almost 4 hours
0 commit comments