Expert guidance for testing and validating GitHub Actions workflows before deployment - catches cache errors, path issues, monorepo dependencies, and service container problems that local testing misses
Interactive expert for testing and validating GitHub Actions workflows before deployment. Prevents common CI failures by catching cache configuration errors, path issues, monorepo dependency problems, and service container configuration mistakes.
This skill provides:
Invoke this skill when:
"Validate my GitHub Actions workflows before I push"
I'll:
"My GitHub Actions workflow is failing with [error message]"
I'll:
"Set up GitHub Actions testing for my new project"
I'll:
ALWAYS specify cache-dependency-path explicitly:
# ❌ WRONG
- uses: actions/setup-node@v4
with:
cache: 'npm'
# ✅ CORRECT
- uses: actions/setup-node@v4
with:
cache: 'npm'
cache-dependency-path: package-lock.json
Why: GitHub Actions cache resolution fails silently in local testing but errors in CI with "Some specified paths were not resolved, unable to cache dependencies."
ALWAYS build workspace dependencies before type checking:
# ❌ WRONG
- run: npm ci
- run: npx tsc --noEmit
# ✅ CORRECT
- run: npm ci
- run: npm run build --workspace=@prpm/types
- run: npm run build --workspace=@prpm/registry-client
- run: npx tsc --noEmit
Why: TypeScript needs compiled output from workspace dependencies. Local development has pre-built artifacts, but CI starts clean.
ALWAYS run npm ci from root, not workspace directories:
# ❌ WRONG
- working-directory: packages/infra
run: npm ci
# ✅ CORRECT
- run: npm ci
- working-directory: packages/infra
run: pulumi preview
Why: npm workspaces are managed from root. Workspace directories don't have their own package-lock.json.
Service containers can't override CMD via options:
# ❌ WRONG
services:
minio:
image: minio/minio:latest
options: server /data # Ignored!
# ✅ CORRECT
services:
minio:
image: minio/minio:latest
steps:
- run: |
docker exec $(docker ps -q --filter ancestor=minio/minio:latest) \
sh -c "minio server /data &"
Why: GitHub Actions service containers ignore custom commands. They must be started manually in steps.
# macOS
brew install act actionlint yamllint
# Linux
curl https://raw.githubusercontent.com/nektos/act/master/install.sh | sudo bash
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
pip install yamllint
I'll create .github/scripts/validate-workflows.sh:
#!/bin/bash
set -e
echo "🔍 Validating GitHub Actions workflows..."
# 1. Static analysis
actionlint .github/workflows/*.yml
yamllint .github/workflows/*.yml
# 2. Cache configuration check
for file in .github/workflows/*.yml; do
if grep -q "cache: 'npm'" "$file"; then
if ! grep -A 2 "cache: 'npm'" "$file" | grep -q "cache-dependency-path"; then
echo "❌ $file: Missing explicit cache-dependency-path"
exit 1
fi
fi
done
# 3. Path validation
grep -r "working-directory:" .github/workflows/*.yml | while read -r line; do
dir=$(echo "$line" | sed 's/.*working-directory: //' | tr -d '"')
if [ ! -d "$dir" ]; then
echo "❌ Directory does not exist: $dir"
exit 1
fi
done
# 4. Check for explicit cache paths
grep -r "cache-dependency-path:" .github/workflows/*.yml | while read -r line; do
path=$(echo "$line" | sed 's/.*cache-dependency-path: //' | tr -d '"')
if [ ! -f "$path" ]; then
echo "❌ Cache dependency path does not exist: $path"
exit 1
fi
done
echo "✅ All workflow validations passed"
Before pushing workflow changes:
actionlint .github/workflows/*.yml.github/scripts/validate-workflows.shact pull_request -W .github/workflows/[workflow].yml -nRoot Cause: Workspace dependency not built before type checking
Why Local Works: Previous builds exist in node_modules/
Fix:
- name: Build @prpm/types
run: npm run build --workspace=@prpm/types
- name: Type check
run: npx tsc --noEmit
Root Cause: Missing or incorrect cache-dependency-path
Why act Doesn't Catch: act skips caching entirely
Fix:
- uses: actions/setup-node@v4
with:
cache: 'npm'
cache-dependency-path: package-lock.json # Explicit!
Root Cause: Running npm ci from workspace directory
Why Local Works: May have workspace-specific package-lock.json
Fix:
# Run from root
- run: npm ci
# Then use working-directory for commands
- working-directory: packages/infra
run: pulumi preview
Root Cause: Custom command in options is ignored
Why Local Works: docker-compose uses different container runtime
Fix:
steps:
- run: docker exec [container] sh -c "command &"
Local testing with act doesn't catch:
Solution: Use the complete validation suite (actionlint + custom validators + act dry run)
When you encounter a workflow failure:
User: "My workflow is failing with 'Some specified paths were not resolved, unable to cache dependencies'"
Me: This is a cache resolution error. You're using cache: 'npm' without specifying cache-dependency-path. GitHub Actions is trying to find package-lock.json but can't locate it.
Here's the fix:
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: package-lock.json # Add this
This wasn't caught by act because it skips caching entirely. To prevent this in the future, run:
.github/scripts/validate-workflows.sh
This script checks for missing cache-dependency-path configurations.
User: "TypeScript can't find '@prpm/types' in CI but works locally"
Me: This is a monorepo build order issue. Your local environment has previously built @prpm/types, but CI starts clean.
Add this before your type check:
- name: Build @prpm/types
run: npm run build --workspace=@prpm/types
Why local worked: You've previously run npm run build which compiled @prpm/types to dist/. That compiled output exists in your node_modules. CI doesn't have this.
To test this scenario locally, delete your dist/ folders and try again:
rm -rf packages/*/dist
npx tsc --noEmit # Should fail
npm run build --workspace=@prpm/types
npx tsc --noEmit # Should pass
After each workflow failure in CI:
brew upgrade act actionlint yamllintThis skill helps you:
Invoke me whenever you're working with GitHub Actions to ensure your workflows are solid before they hit CI.
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer