33# gh aw compile
44# For more information: https://github.com/githubnext/gh-aw/blob/main/.github/instructions/github-agentic-workflows.instructions.md
55#
6- # Source: githubnext/agentics/workflows/ci-doctor.md
6+ # Source: githubnext/agentics/workflows/ci-doctor.md@9586b5fc47d008cd1cf42f6c298a46abfd774fb5
7+ #
8+ # Effective stop-time: 2025-11-16 04:52:03
79#
810# Job Dependency Graph:
911# ```mermaid
1416# create_issue["create_issue"]
1517# detection["detection"]
1618# missing_tool["missing_tool"]
19+ # pre_activation["pre_activation"]
20+ # pre_activation --> activation
1721# agent --> add_comment
1822# create_issue --> add_comment
1923# detection --> add_comment
@@ -50,11 +54,7 @@ name: "CI Failure Doctor"
5054 - Daily Perf Improver
5155 - Daily Test Coverage Improver
5256
53- permissions :
54- actions : read
55- contents : read
56- issues : read
57- pull-requests : read
57+ permissions : read-all
5858
5959concurrency :
6060 group : " gh-aw-${{ github.workflow }}"
@@ -63,8 +63,10 @@ run-name: "CI Failure Doctor"
6363
6464jobs :
6565 activation :
66+ needs : pre_activation
6667 if : >
67- (github.event.workflow_run.conclusion == 'failure') && ((github.event_name != 'workflow_run') || (github.event.workflow_run.repository.id == github.repository_id))
68+ ((needs.pre_activation.outputs.activated == 'true') && (github.event.workflow_run.conclusion == 'failure')) &&
69+ ((github.event_name != 'workflow_run') || (github.event.workflow_run.repository.id == github.repository_id))
6870 runs-on : ubuntu-slim
6971 permissions :
7072 contents : read
@@ -197,9 +199,8 @@ jobs:
197199 GH_AW_CREATED_ISSUE_URL : ${{ needs.create_issue.outputs.issue_url }}
198200 GH_AW_CREATED_ISSUE_NUMBER : ${{ needs.create_issue.outputs.issue_number }}
199201 GH_AW_WORKFLOW_NAME : " CI Failure Doctor"
200- GH_AW_WORKFLOW_SOURCE : " githubnext/agentics/workflows/ci-doctor.md"
201- GH_AW_WORKFLOW_SOURCE_URL : " ${{ github.server_url }}/githubnext/agentics/tree/main/workflows/ci-doctor.md"
202- GH_AW_CAMPAIGN : " ci-doctor-failures"
202+ GH_AW_WORKFLOW_SOURCE : " githubnext/agentics/workflows/ci-doctor.md@9586b5fc47d008cd1cf42f6c298a46abfd774fb5"
203+ GH_AW_WORKFLOW_SOURCE_URL : " ${{ github.server_url }}/githubnext/agentics/tree/9586b5fc47d008cd1cf42f6c298a46abfd774fb5/workflows/ci-doctor.md"
203204 with :
204205 github-token : ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
205206 script : |
@@ -569,11 +570,7 @@ jobs:
569570 agent :
570571 needs : activation
571572 runs-on : ubuntu-latest
572- permissions :
573- actions : read
574- contents : read
575- issues : read
576- pull-requests : read
573+ permissions : read-all
577574 concurrency :
578575 group : " gh-aw-copilot-${{ github.workflow }}"
579576 env :
@@ -1591,7 +1588,7 @@ jobs:
15911588
15921589 ### Phase 3: Historical Context Analysis
15931590 1. **Search Investigation History**: Use file-based storage to search for similar failures:
1594- - Read from cached investigation files in `/tmp/gh-aw/ memory/investigations/`
1591+ - Read from cached investigation files in `/tmp/memory/investigations/`
15951592 - Parse previous failure patterns and solutions
15961593 - Look for recurring error signatures
15971594 2. **Issue History**: Search existing issues for related problems
@@ -1615,8 +1612,8 @@ jobs:
16151612
16161613 ### Phase 5: Pattern Storage and Knowledge Building
16171614 1. **Store Investigation**: Save structured investigation data to files:
1618- - Write investigation report to `/tmp/gh-aw/ memory/investigations/<timestamp>-<run-id>.json`
1619- - Store error patterns in `/tmp/gh-aw/ memory/patterns/`
1615+ - Write investigation report to `/tmp/memory/investigations/<timestamp>-<run-id>.json`
1616+ - Store error patterns in `/tmp/memory/patterns/`
16201617 - Maintain an index file of all investigations for fast searching
16211618 2. **Update Pattern Database**: Enhance knowledge with new findings by updating pattern files
16221619 3. **Save Artifacts**: Store detailed logs and analysis in the cached directories
@@ -1699,8 +1696,8 @@ jobs:
16991696
17001697 ## Cache Usage Strategy
17011698
1702- - Store investigation database and knowledge patterns in `/tmp/gh-aw/ memory/investigations/` and `/tmp/gh-aw /memory/patterns/`
1703- - Cache detailed log analysis and artifacts in `/tmp/gh-aw/ investigation/logs/` and `/tmp/gh-aw /investigation/reports/`
1699+ - Store investigation database and knowledge patterns in `/tmp/memory/investigations/` and `/tmp/memory/patterns/`
1700+ - Cache detailed log analysis and artifacts in `/tmp/investigation/logs/` and `/tmp/investigation/reports/`
17041701 - Persist findings across workflow runs using GitHub Actions cache
17051702 - Build cumulative knowledge about failure patterns and solutions using structured JSON files
17061703 - Use file-based indexing for fast pattern matching and similarity detection
@@ -4206,9 +4203,8 @@ jobs:
42064203 GH_AW_AGENT_OUTPUT : ${{ env.GH_AW_AGENT_OUTPUT }}
42074204 GH_AW_ISSUE_TITLE_PREFIX : " ${{ github.workflow }}"
42084205 GH_AW_WORKFLOW_NAME : " CI Failure Doctor"
4209- GH_AW_WORKFLOW_SOURCE : " githubnext/agentics/workflows/ci-doctor.md"
4210- GH_AW_WORKFLOW_SOURCE_URL : " ${{ github.server_url }}/githubnext/agentics/tree/main/workflows/ci-doctor.md"
4211- GH_AW_CAMPAIGN : " ci-doctor-failures"
4206+ GH_AW_WORKFLOW_SOURCE : " githubnext/agentics/workflows/ci-doctor.md@9586b5fc47d008cd1cf42f6c298a46abfd774fb5"
4207+ GH_AW_WORKFLOW_SOURCE_URL : " ${{ github.server_url }}/githubnext/agentics/tree/9586b5fc47d008cd1cf42f6c298a46abfd774fb5/workflows/ci-doctor.md"
42124208 with :
42134209 github-token : ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
42144210 script : |
@@ -4803,9 +4799,8 @@ jobs:
48034799 env :
48044800 GH_AW_AGENT_OUTPUT : ${{ env.GH_AW_AGENT_OUTPUT }}
48054801 GH_AW_WORKFLOW_NAME : " CI Failure Doctor"
4806- GH_AW_WORKFLOW_SOURCE : " githubnext/agentics/workflows/ci-doctor.md"
4807- GH_AW_WORKFLOW_SOURCE_URL : " ${{ github.server_url }}/githubnext/agentics/tree/main/workflows/ci-doctor.md"
4808- GH_AW_CAMPAIGN : " ci-doctor-failures"
4802+ GH_AW_WORKFLOW_SOURCE : " githubnext/agentics/workflows/ci-doctor.md@9586b5fc47d008cd1cf42f6c298a46abfd774fb5"
4803+ GH_AW_WORKFLOW_SOURCE_URL : " ${{ github.server_url }}/githubnext/agentics/tree/9586b5fc47d008cd1cf42f6c298a46abfd774fb5/workflows/ci-doctor.md"
48094804 with :
48104805 github-token : ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
48114806 script : |
@@ -4909,3 +4904,46 @@ jobs:
49094904 core.setFailed(`Error processing missing-tool reports: ${error}`);
49104905 });
49114906
4907+ pre_activation :
4908+ if : ${{ github.event.workflow_run.conclusion == 'failure' }}
4909+ runs-on : ubuntu-slim
4910+ outputs :
4911+ activated : ${{ steps.check_stop_time.outputs.stop_time_ok == 'true' }}
4912+ steps :
4913+ - name : Check stop-time limit
4914+ id : check_stop_time
4915+ uses : actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
4916+ env :
4917+ GH_AW_STOP_TIME : 2025-11-16 04:52:03
4918+ GH_AW_WORKFLOW_NAME : " CI Failure Doctor"
4919+ with :
4920+ script : |
4921+ async function main() {
4922+ const stopTime = process.env.GH_AW_STOP_TIME;
4923+ const workflowName = process.env.GH_AW_WORKFLOW_NAME;
4924+ if (!stopTime) {
4925+ core.setFailed("Configuration error: GH_AW_STOP_TIME not specified.");
4926+ return;
4927+ }
4928+ if (!workflowName) {
4929+ core.setFailed("Configuration error: GH_AW_WORKFLOW_NAME not specified.");
4930+ return;
4931+ }
4932+ core.info(`Checking stop-time limit: ${stopTime}`);
4933+ const stopTimeDate = new Date(stopTime);
4934+ if (isNaN(stopTimeDate.getTime())) {
4935+ core.setFailed(`Invalid stop-time format: ${stopTime}. Expected format: YYYY-MM-DD HH:MM:SS`);
4936+ return;
4937+ }
4938+ const currentTime = new Date();
4939+ core.info(`Current time: ${currentTime.toISOString()}`);
4940+ core.info(`Stop time: ${stopTimeDate.toISOString()}`);
4941+ if (currentTime >= stopTimeDate) {
4942+ core.warning(`⏰ Stop time reached. Workflow execution will be prevented by activation job.`);
4943+ core.setOutput("stop_time_ok", "false");
4944+ return;
4945+ }
4946+ core.setOutput("stop_time_ok", "true");
4947+ }
4948+ await main();
4949+
0 commit comments