๐Ÿšจ CI/CD Enhancement Request: Auto-detect pnpm cache setup dependencies

Status Closed โ€” not planned
Maintainer reply None cached
Activity 4 comments ยท opened Aug 10, 2025 ยท closed Jan 7, 2026

๐Ÿšจ CI/CD Pipeline Failure - pnpm Cache Setup Issue

๐ŸŽฏ Problem Summary

GitHub Actions workflow fails at "Setup Node.js & pnpm cache" step with actions/setup-node@v4 when using cache: 'pnpm' because pnpm is not pre-installed.

๐Ÿ” Root Cause Analysis

  • Error: actions/setup-node@v4 with cache: 'pnpm' requires pnpm to be installed BEFORE the setup-node step
  • Impact: All CI/CD workflows hanging/failing on dependency resolution
  • Context: pnpm workspace monorepo with NestJS API + Nuxt.js web apps

โœ… Solution Implemented

# BEFORE (โŒ Fails)
- name: ๐Ÿ“ฆ Setup Node.js & pnpm cache
  uses: actions/setup-node@v4
  with:
    node-version: '20'
    cache: 'pnpm'  # โŒ Fails - pnpm not installed yet

# AFTER (โœ… Works)
- name: ๐Ÿ“ฆ Setup pnpm
  uses: pnpm/action-setup@v2
  with:
    version: 8
    
- name: ๐Ÿ“ฆ Setup Node.js & pnpm cache  
  uses: actions/setup-node@v4
  with:
    node-version: '20'
    cache: 'pnpm'  # โœ… Works - pnpm now available

๐Ÿ”ง Technical Details

  • Repository: pnpm workspace monorepo
  • Node.js: v20
  • pnpm: v8
  • Actions:
  • actions/setup-node@v4
  • pnpm/action-setup@v2

๐Ÿ“‹ Additional Optimizations Applied

env:
  PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
  PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: 1
  HUSKY: 0

jobs:
  build:
    timeout-minutes: 15  # Prevent hanging jobs
    steps:
      - name: ๐Ÿ“ฆ Setup pnpm
        uses: pnpm/action-setup@v2
        with:
          version: 8
          
      - name: ๐Ÿ“ฆ Setup Node.js & pnpm cache
        uses: actions/setup-node@v4
        with:
          node-version: '20'
          cache: 'pnpm'
          
      - name: ๐Ÿ“ฅ Install dependencies
        run: pnpm install --frozen-lockfile

๐ŸŽฏ Request for Claude Code Support

Could Claude Code GitHub Actions be enhanced to:

  1. Auto-detect pnpm requirements: When cache: 'pnpm' is used, automatically suggest adding pnpm/action-setup first
  2. Workflow validation: Check action order dependencies before committing workflow files
  3. Monorepo templates: Provide optimized workflow templates for pnpm workspaces
  4. Timeout recommendations: Suggest appropriate timeout-minutes based on project size

๐Ÿ“Š Current Status

  • โœ… Issue identified and fixed manually
  • โœ… Shadow workflow ci-cd-mvp-v2.yml created for testing
  • ๐Ÿ”„ Monitoring pipeline execution
  • โณ Ready for PR to main branch once validated

๐Ÿ”— Related Files

  • .github/workflows/ci-cd-mvp-v2.yml (fixed workflow)
  • pnpm-workspace.yaml (monorepo config)
  • package.json (workspace root)

๐Ÿ’ก Impact

This fix enables reliable CI/CD for pnpm monorepos and prevents common setup-node cache failures that affect many TypeScript/Node.js projects.

---
Priority: High - Blocks all CI/CD operations
Environment: GitHub Actions, pnpm workspace, Node.js 20
Fix Applied: โœ… Working solution implemented

View original on GitHub โ†—

This issue has 4 comments on GitHub. Read the full discussion on GitHub โ†—