Skip to content

🏥 CI Failure Investigation - Run #17359897066: JavaScript Dependency Error in GitHub Actions Workflow #1568

@github-actions

Description

@github-actions

🏥 CI Failure Investigation - Run #17359897066

Summary

Daily Test Coverage Improver workflow failed due to missing @actions/core JavaScript module during log parsing step, despite the main workflow functionality completing successfully.

Failure Details

  • Run: 17359897066
  • Commit: 05b3fce
  • Trigger: workflow_dispatch
  • Workflow: Daily Test Coverage Improver
  • Failed Step: "Parse agent logs for step summary" (Step 16)
  • Duration: 14m 10s total runtime

Root Cause Analysis

Primary Issue: JavaScript dependency resolution failure in GitHub Actions runtime environment.

Specific Error:

Error: Cannot find module '@actions/core'
Require stack:
- /home/runner/work/_actions/actions/github-script/v7/dist/index.js

Critical Context: The workflow functionally succeeded - all core tasks completed successfully:

The failure occurred only in the post-processing log parsing step, not in the core functionality.

Failed Jobs and Errors

Job: daily-test-coverage-improver (49278477912)

  • Overall Status: FAILURE ❌ (due to step 16 only)
  • Core Functionality: SUCCESS ✅ (steps 1-15 completed perfectly)
  • Failed Step: Step 16 "Parse agent logs for step summary"
  • Error Context: actions/github-script@v7 cannot import @actions/core module

JavaScript Runtime Error Details:

at Module._resolveFilename (node:internal/modules/cjs/loader:1212:15)
at resolve (node:internal/modules/helpers:193:19)
at Object.apply (/home/runner/work/_actions/actions/github-script/v7/dist/index.js:35469:43)
at main (eval at callAsyncFunction (...), <anonymous>:5:16)

Investigation Findings

Workflow Success Context

The actual Daily Test Coverage Improver completed successfully:

Technical Analysis

The failure is in the log summarization infrastructure, not the core workflow:

  1. Working Components: Claude Code execution, file operations, git operations, GitHub API calls
  2. Failing Component: Post-processing JavaScript action for log parsing
  3. Missing Dependency: @actions/core npm package not available in runner environment
  4. Action Version: actions/github-script@v7 attempting to require missing module

Environment Context

  • Runner: ubuntu-latest (GitHub-hosted)
  • Node.js: Version embedded in github-script action
  • Missing Module: @actions/core - core GitHub Actions toolkit library
  • Script Context: Attempting to parse Claude Code execution logs for step summary

Recommended Actions

Immediate Fix ⚡ HIGH PRIORITY

  1. Fix GitHub Script Dependency

    # In .github/workflows/daily-test-improver.lock.yml
    - name: Parse agent logs for step summary
      uses: actions/github-script@v7
      with:
        script: |
          // Add explicit import with error handling
          try {
            const core = require('@actions/core');
            // ... rest of script
          } catch (error) {
            console.log('Warning: @actions/core not available, skipping summary');
            console.log('Core workflow completed successfully');
            return;
          }
  2. Alternative: Use Different Action

    # Replace github-script with actions/core-compatible action
    - name: Parse agent logs for step summary  
      uses: actions/setup-node@v4
      with:
        node-version: '20'
    - run: |
        npm install @actions/core
        node .github/scripts/parse-logs.js
  3. Fallback: Skip Log Parsing

    # Make the step non-critical
    - name: Parse agent logs for step summary
      continue-on-error: true
      uses: actions/github-script@v7

Root Cause Resolution

  1. Dependency Management: Ensure @actions/core is available in runner environment
  2. Action Version: Consider upgrading to newer github-script version or using different approach
  3. Error Handling: Add proper error handling for missing dependencies
  4. Testing: Test workflow changes in a fork before merging

Verification Steps

# 1. Test the workflow locally or in fork
gh workflow run daily-test-improver.lock.yml

# 2. Verify all steps complete including log parsing
# Monitor: https://github.com/fsprojects/FSharp.Data/actions

# 3. Confirm core functionality still works regardless of log parsing

Prevention Strategies

Short-term

  • Graceful Degradation: Make log parsing step non-critical with continue-on-error: true
  • Dependency Pinning: Pin specific versions of actions with known working dependencies
  • Error Boundaries: Wrap all JavaScript operations in try-catch blocks

Long-term

  • Self-Contained Scripts: Move complex JavaScript to separate files with explicit dependencies
  • Alternative Libraries: Use lightweight alternatives to @actions/core for non-critical features
  • Workflow Testing: Add CI workflow validation to catch dependency issues early

AI Team Self-Improvement

Additional prompting instructions for AI coding agents:

### GitHub Actions Workflow Development
1. **Always check action dependencies** - verify required npm modules are available in action runtime
2. **Use continue-on-error: true** for non-critical post-processing steps
3. **Test JavaScript actions locally** before committing to workflow files
4. **Prefer built-in GitHub Actions** over custom JavaScript when possible
5. **Add error handling** for all require() statements in github-script actions
6. **Consider action versioning** - newer versions may have different dependency requirements
7. **Separate core functionality from reporting** - ensure main workflow succeeds even if logging fails

### Debugging Workflow Failures
8. **Distinguish functional vs cosmetic failures** - core success vs. reporting/logging issues
9. **Check module resolution errors** - often indicate action version mismatches
10. **Use artifacts and outputs** as alternatives to complex JavaScript log processing

Historical Context

Pattern Recognition: This is a Dependency/Configuration Issue - a new type of failure not previously seen in this repository:

  • First Instance: No similar @actions/core dependency errors found in issue history
  • Workflow Age: The daily-test-improver workflow is relatively new infrastructure
  • Action Ecosystem: GitHub Actions dependency ecosystem can have runtime environment variations
  • Impact Scope: Cosmetic failure only - core functionality completed successfully

Similar Patterns: While no identical issues exist, the repository has seen other workflow-related issues:

Resolution Track Record: The maintainers have consistently resolved workflow issues promptly with targeted fixes.

Impact Assessment

Functional Success Confirmation

✅ IMPORTANT: Despite the CI "failure", the workflow achieved its objectives:

The "failure" is purely in the post-processing summary generation, not the core functionality.


AI-generated content by CI Failure Doctor may contain mistakes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions