
github-actions-local-checks
by moogah
SKILL.md
name: github-actions-local-checks description: Proactively run GitHub Actions pipeline checks locally before pushing code. Use when making code changes to catch test, lint, and type-check failures early.
GitHub Actions Local Checks
Overview
When working in a repository with GitHub Actions, run relevant pipeline checks locally before pushing. This catches failures early and is much faster than waiting for CI to run and report errors.
When to Use This Skill
- Before committing and pushing code changes
- After making significant changes to ensure tests still pass
- When adding new features or fixing bugs
- Before creating a pull request
Identifying Steps to Run Locally
Look at workflow files in .github/workflows/*.yml to identify runnable steps:
Run Locally (Fast Feedback)
- Tests:
npm test,npm run test:unit,jest --coverage - Linting:
npm run lint,eslint . - Type Checking:
npm run type-check,tsc --noEmit - Prettier/Formatting:
npx prettier --check . - Build validation:
npm run build(if fast)
Skip Locally (CI-Only)
- Deployments:
cdk deploy, deployment scripts - Docker builds/pushes: Slow and require credentials
- Integration tests: If they require external services
- Codecov uploads: CI handles this
Workflow Pattern
-
Identify the relevant workflow file
- For PRs: Usually
.github/workflows/run-tests.ymlor similar - For deployments: Usually
.github/workflows/deploy-*.yml
- For PRs: Usually
-
Find test/lint steps in the workflow
- Look for
run:commands understeps: - Note the
working-directory:if specified - Identify which commands to run
- Look for
-
Run commands locally
# Example: Run tests for a specific stack cd stacks/oncall-data-sync-stack npm run test -- --coverage # Example: Run linting npm run lint # Example: Type checking npm run type-check -
Fix any failures before pushing
Common Patterns
Matrix strategies
If workflow uses matrix (e.g., testing multiple stacks), run checks for each affected area:
matrix:
stack: [stack-a, stack-b, stack-c]
→ Run tests in each stack directory you modified
Working directories
Match the workflow's working-directory:
- name: Run tests
working-directory: ./stacks/my-stack
run: npm test
→ Run cd stacks/my-stack && npm test locally
Conditional steps
If workflow has if: conditions, check if they apply to your changes:
- name: Integration tests
if: github.event_name == 'push'
run: npm run test:integration
→ Skip if you're just testing locally, but run if condition matches
Example
Scenario: Modified code in stacks/oncall-data-sync-stack/
Workflow file shows:
- name: Run unit tests
working-directory: ./stacks/oncall-data-sync-stack
run: npm run test -- --coverage
Run locally:
cd stacks/oncall-data-sync-stack
npm run test -- --coverage
Result: Catches test failures before pushing, saves time waiting for CI.
Benefits
- Faster feedback loop: Seconds vs minutes waiting for CI
- Cheaper: No wasted CI compute on failures
- Better workflow: Fix issues immediately while context is fresh
- Fewer failed builds: Keep CI green
スコア
総合スコア
リポジトリの品質指標に基づく評価
SKILL.mdファイルが含まれている
ライセンスが設定されている
100文字以上の説明がある
GitHub Stars 100以上
3ヶ月以内に更新がある
10回以上フォークされている
オープンIssueが50未満
プログラミング言語が設定されている
1つ以上のタグが設定されている
レビュー
レビュー機能は近日公開予定です