github-actions-testing
Skill124 starsChanged 8 months agoMITView on GitHub
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
- Deletes or force-pushes
- Installs packages
We split this skill into the rules it gives an agent
21 rules. About 0 are common, 21 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈21
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 17
Cache Configuration: Ensure cache-dependency-path is correctly specified
- Distinctive: line 20
Path Validation: Verify all paths exist and are accessible
- Distinctive: line 21
Local Testing: Run workflows locally with act (Docker-based simulation)
- Distinctive: line 42
Run actionlint on all workflow files
- Distinctive: line 43
Check for missing cache-dependency-path configurations
- Distinctive: line 45
Verify monorepo build order is correct
- Distinctive: line 46
Check service container configurations
- Distinctive: line 212
Before pushing workflow changes:
- Distinctive: line 217
Check Cache Paths: Verify all cache-dependency-path values exist
- Distinctive: line 218
Check Build Order: Ensure workspace dependencies built before type checks
- Distinctive: line 288
Solution: Use the complete validation suite (actionlint + custom validators + act dry run)
- Distinctive: line 292
When you encounter a workflow failure:
- Distinctive: line 328
Add this before your type check:
- Distinctive: line 346
After each workflow failure in CI:
- Distinctive: line 349
Document: Add to the common failure patterns
- Distinctive: line 350
Validate: Update validation scripts to catch it next time
- Distinctive: line 351
Test: Ensure the validator actually catches the issue
- Distinctive: line 355
Always validate before pushing: Run the complete validation suite
- Distinctive: line 357
Test in clean environment occasionally: Use Docker to simulate fresh CI
- Distinctive: line 358
Document failures: Add new patterns to validation scripts
- Distinctive: line 359
Use explicit configurations: Never rely on defaults for cache, paths, or commands
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
SKILL: GitHub Actions Testing & Validation Expert
Description
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.
Capabilities
This skill provides:
- Pre-Push Validation: Complete workflow validation before pushing to GitHub
- Cache Configuration: Ensure cache-dependency-path is correctly specified
- Monorepo Build Order: Validate workspace dependency build sequences
- Service Container Setup: Guide proper service container configuration
- Path Validation: Verify all paths exist and are accessible
- Local Testing: Run workflows locally with act (Docker-based simulation)
- Static Analysis: Lint workflows with actionlint and yamllint
When to Use This Skill
Invoke this skill when:
- Creating or modifying GitHub Actions workflows
- Debugging workflow failures in CI
- Setting up new repositories with CI/CD
- Migrating to monorepo architecture
- Adding service containers to workflows
- Experiencing cache-related failures
- Getting "module not found" errors in CI but not locally
Usage
Quick Validation
"Validate my GitHub Actions workflows before I push"
I'll:
- Run actionlint on all workflow files
- Check for missing cache-dependency-path configurations
- Validate all working-directory paths exist
- Verify monorepo build order is correct
- Check service container configurations
- Provide a pre-push checklist
Debugging Workflow Failures
"My GitHub Actions workflow is failing with [error message]"
I'll:
- Analyze the error message
- Identify the root cause
- Explain why local testing didn't catch it
- Provide the correct configuration
- Show how to test the fix locally
Setup New Repository
"Set up GitHub Actions testing for my new project"
I'll:
- Install required tools (act, actionlint, yamllint)
- Create validation scripts
- Set up pre-push hooks
- Configure recommended workflows
- Provide testing procedures
Critical Rules I Enforce
1. Cache Configuration
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.jsonWhy: GitHub Actions cache resolution fails silently in local testing but errors in CI with "Some specified paths were not resolved, unable to cache dependencies."
2. Monorepo Build Order
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 --noEmitWhy: TypeScript needs compiled output from workspace dependencies. Local development has pre-built artifacts, but CI starts clean.
3. npm ci in Monorepos
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 previewWhy: npm workspaces are managed from root. Workspace directories don't have their own package-lock.json.
4. Service Containers
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.
Validation Tools
Required Tools
# 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 yamllintValidation Script
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"Pre-Push Checklist
Before pushing workflow changes:
- Lint:
actionlint .github/workflows/*.yml - Validate:
.github/scripts/validate-workflows.sh - Dry Run:
act pull_request -W .github/workflows/[workflow].yml -n - Check Cache Paths: Verify all cache-dependency-path values exist
- Check Build Order: Ensure workspace dependencies built before type checks
- Service Containers: Confirm manual startup if custom commands needed
Common Failure Patterns
"Cannot find module '@prpm/types'"
Root 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"Cache resolution error"
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!"npm ci requires package-lock.json"
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"Service container not starting"
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 &"Why act Alone Isn't Enough
Local testing with act doesn't catch:
- Cache Validation: act skips GitHub's cache system entirely
- Service Commands: Different container runtime, different behavior
- Build Artifacts: Local has pre-built workspace dependencies
- Clean Environment: CI starts completely fresh every time
- GitHub-Specific Features: Some actions only work on GitHub's runners
Solution: Use the complete validation suite (actionlint + custom validators + act dry run)
Interactive Debugging
When you encounter a workflow failure:
- Share the error: Paste the exact GitHub Actions error message
- I'll analyze: Identify the root cause and why local testing didn't catch it
- I'll fix: Provide corrected workflow configuration
- I'll validate: Show how to test the fix locally
- I'll explain: Clarify why the issue occurred and how to prevent it
Example Interactions
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 thisThis wasn't caught by act because it skips caching entirely. To prevent this in the future, run:
.github/scripts/validate-workflows.shThis 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/typesWhy 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 passContinuous Improvement
After each workflow failure in CI:
- Analyze: Why didn't local testing catch this?
- Document: Add to the common failure patterns
- Validate: Update validation scripts to catch it next time
- Test: Ensure the validator actually catches the issue
Best Practices
- Always validate before pushing: Run the complete validation suite
- Keep tools updated:
brew upgrade act actionlint yamllint - Test in clean environment occasionally: Use Docker to simulate fresh CI
- Document failures: Add new patterns to validation scripts
- Use explicit configurations: Never rely on defaults for cache, paths, or commands
Summary
This skill helps you:
- ✅ Catch 90%+ of workflow failures before pushing
- ✅ Understand why local testing didn't catch issues
- ✅ Fix common GitHub Actions problems quickly
- ✅ Build confidence in your CI/CD pipeline
- ✅ Reduce iteration time (no more push-fail-fix-push cycles)
Invoke me whenever you're working with GitHub Actions to ensure your workflows are solid before they hit CI.
In this repository64 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- beanstalk-deployCursor rule
- .cursor/rules/core-principles.mdcCursor rule
- .cursor/rules/creating-agents-md.mdcCursor rule
- .cursor/rules/creating-claude-agents.mdCursor rule
- .cursor/rules/creating-claude-commands.mdCursor rule
- .cursor/rules/creating-claude-hooks.mdCursor rule
- .cursor/rules/creating-continue-packages.mdCursor rule
- .cursor/rules/creating-copilot-packages.mdCursor rule
- .cursor/rules/creating-cursor-commands.mdCursor rule
- .cursor/rules/creating-cursor-rules.mdcCursor rule
- .cursor/rules/creating-kiro-agents.mdcCursor rule
- .cursor/rules/creating-kiro-packages.mdCursor rule
- .cursor/rules/creating-skills.mdcCursor rule
- .cursor/rules/creating-windsurf-packages.mdCursor rule
- .cursor/rules/elastic-beanstalk-deployment.mdCursor rule
- .cursor/rules/format-conversion.mdcCursor rule
- .cursor/rules/github-actions-testing.mdcCursor rule
- .cursor/rules/karen-repo-reviewer.mdcCursor rule
- .cursor/rules/prpm-json-best-practices.mdcCursor rule
- .cursor/rules/self-improve-cursor.mdcCursor rule
- .cursor/rules/testing-patterns.mdcCursor rule
- .cursor/rules/typescript-type-safety.mdcCursor rule
- .cursor/rules/typescript-type-specialist.mdcCursor rule
- creating-agent-skillsSkill
- adding-new-ai-formatSkill
- agent-builderSkill
- aws-beanstalk-expertSkill
- beanstalk-deploySkill
- claude-hook-writerSkill
- creating-agents-mdSkill
- creating-claude-agentsSkill
- creating-claude-commandsSkill
- creating-claude-hooksSkill
- creating-claude-rulesSkill
- creating-continue-packagesSkill
- creating-copilot-packagesSkill
- creating-cursor-commandsSkill
- creating-cursor-rules-skillSkill
- creating-kiro-agentsSkill
- creating-kiro-packagesSkill
- creating-opencode-agentsSkill
- creating-opencode-pluginsSkill
- creating-skillsSkill
- creating-windsurf-packagesSkill
- creating-zed-extensionsSkill
- documentation-standardsSkill
- elastic-beanstalk-deploymentSkill
- human-writingSkill
- integrating-stripe-webhooksSkill
- karen-repo-reviewerSkill
- npm-trusted-publishingSkill
- osgrepSkill
- postgres-migrationsSkill
- prpm-developmentSkill
- prpm-json-best-practicesSkill
- pulumi-troubleshootingSkill
- self-improvingSkill
- slash-command-builderSkill
- The first 60 shown.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

