Skip to content

Capture npm debug logs in Deploy To Artifacts workflow failures - #3101

Draft
aleks-pro with Copilot wants to merge 2 commits into
masterfrom
copilot/add-npm-log-capture
Draft

Capture npm debug logs in Deploy To Artifacts workflow failures#3101
aleks-pro with Copilot wants to merge 2 commits into
masterfrom
copilot/add-npm-log-capture

Conversation

Copilot AI commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Deploy To Artifacts can fail during npm pack with Exit handler never called!, but current workflow output lacks npm debug logs needed to diagnose CI-only failures. This PR adds failure-path diagnostics so npm logs are visible in job output and preserved as artifacts.

  • Build failure diagnostics

    • Added a failure-only step in deploy-to-artifacts.yml to enumerate and print all npm debug logs from ~/.npm/_logs into workflow output.
    • Handles missing logs gracefully (non-fatal message instead of masking the original failure).
  • Artifact capture for investigation

    • Added a failure-only actions/upload-artifact@v4 step to upload ~/.npm/_logs/*.log as npm-debug-logs.
    • Uses if-no-files-found: warn so artifact upload does not hide root-cause failures.
- name: Show npm debug logs on failure
  if: failure()
  run: |
    shopt -s nullglob
    logs=("$HOME/.npm/_logs/"*.log)

    if [ ${#logs[@]} -eq 0 ]; then
      echo "No npm debug logs found in $HOME/.npm/_logs"
      exit 0
    fi

    for log in "${logs[@]}"; do
      echo "===== $log ====="
      cat "$log"
      echo
    done

- name: Upload npm debug logs artifact on failure
  if: failure()
  uses: actions/upload-artifact@v4
  with:
    name: npm-debug-logs
    path: ~/.npm/_logs/*.log
    if-no-files-found: warn

Co-authored-by: aleks-pro <14822473+aleks-pro@users.noreply.github.com>
Copilot AI changed the title [WIP] Add steps to capture and upload npm debug logs Capture npm debug logs in Deploy To Artifacts workflow failures Aug 31, 2026
Copilot AI requested a review from aleks-pro August 31, 2026 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants