66 workflow_dispatch :
77 inputs :
88 issue_number :
9- description : ' Issue number to analyze and fix'
9+ description : " Issue number to analyze and fix"
10+ required : true
11+ type : number
12+ workflow_call :
13+ inputs :
14+ issue_number :
15+ description : " Issue number to analyze and fix"
1016 required : true
1117 type : number
1218
1622 # Only run when:
1723 # 1. Issue is opened with 'fuzzer' label, OR
1824 # 2. 'fuzzer' label is added to existing issue, OR
19- # 3. Manually triggered via workflow_dispatch
25+ # 3. Manually triggered via workflow_dispatch, OR
26+ # 4. Called from another workflow (workflow_call)
2027 if : |
28+ github.event_name == 'workflow_call' ||
2129 github.event_name == 'workflow_dispatch' ||
2230 (github.event.action == 'opened' && contains(github.event.issue.labels.*.name, 'fuzzer')) ||
2331 (github.event.action == 'labeled' && github.event.label.name == 'fuzzer')
3543 - name : Checkout repository
3644 uses : actions/checkout@v5
3745
38- - name : Fetch issue details (for workflow_dispatch)
39- if : github.event_name == 'workflow_dispatch'
46+ - name : Fetch issue details (for workflow_dispatch/workflow_call )
47+ if : github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call'
4048 id : fetch_issue
4149 run : |
4250 ISSUE_DATA=$(gh issue view ${{ inputs.issue_number }} --repo ${{ github.repository }} --json number,title,body,labels)
@@ -62,33 +70,39 @@ jobs:
6270
6371 - name : Extract crash details from issue
6472 id : extract
73+ shell : bash
6574 run : |
66- # Use fetched issue body for workflow_dispatch, otherwise use event issue body
67- if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
68- ISSUE_BODY="${{ steps.fetch_issue.outputs.issue_body }}"
75+ # Use fetched issue body for workflow_dispatch/workflow_call, otherwise use event issue body
76+ if [ "${{ github.event_name }}" = "workflow_dispatch" ] || [ "${{ github.event_name }}" = "workflow_call" ]; then
77+ cat > issue_body.txt <<'ISSUE_EOF'
78+ ${{ steps.fetch_issue.outputs.issue_body }}
79+ ISSUE_EOF
6980 else
70- ISSUE_BODY="${{ github.event.issue.body }}"
81+ cat > issue_body.txt <<'ISSUE_EOF'
82+ ${{ github.event.issue.body }}
83+ ISSUE_EOF
7184 fi
7285
7386 # Extract target name from issue body
74- TARGET=$(echo "$ISSUE_BODY" | grep -oP '(?<=\*\*Target\*\*: `)[^`]+' || echo "file_io")
87+ TARGET=$(grep -oP '(?<=\*\*Target\*\*: `)[^`]+' issue_body.txt || echo "file_io")
7588 echo "target=$TARGET" >> $GITHUB_OUTPUT
7689
7790 # Extract crash file name
78- CRASH_FILE=$(echo "$ISSUE_BODY" | grep -oP '(?<=\*\*Crash File\*\*: `)[^`]+' || echo "")
91+ CRASH_FILE=$(grep -oP '(?<=\*\*Crash File\*\*: `)[^`]+' issue_body.txt || echo "")
7992 echo "crash_file=$CRASH_FILE" >> $GITHUB_OUTPUT
8093
8194 # Extract artifact URL
82- ARTIFACT_URL=$(echo "$ISSUE_BODY" | grep -oP 'https://[^\s]+/artifacts/[0-9]+' | head -1 || echo "")
95+ ARTIFACT_URL=$(grep -oP 'https://[^\s]+/artifacts/[0-9]+' issue_body.txt | head -1 || echo "")
8396 echo "artifact_url=$ARTIFACT_URL" >> $GITHUB_OUTPUT
8497
8598 echo "Extracted: target=$TARGET, crash_file=$CRASH_FILE"
99+ rm -f issue_body.txt
86100
87101 - name : Attempt to fix crash with Claude
88102 env :
89- ISSUE_NUMBER : ${{ github.event_name == 'workflow_dispatch' && inputs.issue_number || github.event.issue.number }}
90- ISSUE_TITLE : ${{ github.event_name == 'workflow_dispatch' && steps.fetch_issue.outputs.issue_title || github.event.issue.title }}
91- ISSUE_BODY : ${{ github.event_name == 'workflow_dispatch' && steps.fetch_issue.outputs.issue_body || github.event.issue.body }}
103+ ISSUE_NUMBER : ${{ ( github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call') && inputs.issue_number || github.event.issue.number }}
104+ ISSUE_TITLE : ${{ ( github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call') && steps.fetch_issue.outputs.issue_title || github.event.issue.title }}
105+ ISSUE_BODY : ${{ ( github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call') && steps.fetch_issue.outputs.issue_body || github.event.issue.body }}
92106 TARGET : ${{ steps.extract.outputs.target }}
93107 CRASH_FILE : ${{ steps.extract.outputs.crash_file }}
94108 ARTIFACT_URL : ${{ steps.extract.outputs.artifact_url }}
0 commit comments