This repository contains reusable GitHub Actions workflow templates for consistent CI/CD across projects. These templates ensure code quality, security, and testing standards are enforced automatically.
The workflow templates in this repository provide standardized CI/CD checks that can be easily integrated into any project. Each workflow includes:
- Workflow file (
.yml) - The GitHub Actions workflow definition - Documentation (
.md) - Detailed setup and configuration instructions
All workflows are designed to be:
- β Easy to integrate
- β Well-documented
- β Configurable
- β Consistent across projects
File: workflow-templates/detect-secrets.yml
Scans repositories for potential secrets (API keys, passwords, tokens, etc.) using detect-secrets to prevent accidental commits of sensitive information.
Key Features:
- Uses
detect-secrets[gibberish]==1.5.0 - Requires
.secrets.baselinefile - Runs on pushes and pull requests to
main - Python 3.11 environment
Triggers: push, pull_request (to main branch)
See: detect-secrets.md for detailed documentation
File: workflow-templates/eslint.yml
Runs ESLint and Prettier to ensure code quality and consistent formatting for JavaScript/TypeScript projects.
Key Features:
- ESLint with auto-fix
- Prettier code formatting
- Uses Yarn as package manager
- Node.js 22
- Supports manual workflow dispatch
Triggers: push, pull_request (to main branch), workflow_dispatch
Commands:
yarn run fix .- ESLint with auto-fixyarn prettier --write .- Prettier formatting
See: eslint.md for detailed documentation
File: workflow-templates/npm-test.yml
Comprehensive test suite for Node.js projects including unit tests, coverage, and E2E tests.
Key Features:
- Build verification
- Unit tests
- Test coverage collection
- E2E tests
- Codecov integration (optional)
- Node.js 22.x with npm caching
Triggers: push, pull_request (to main branch)
Required npm Scripts:
npm run build- Build the projectnpm test- Run unit testsnpm run test:cov- Run tests with coveragenpm run test:e2e- Run E2E tests
See: npm-test.md for detailed documentation
File: workflow-templates/pylint.yml
Analyzes Python code quality and enforces coding standards using Pylint.
Key Features:
- Multi-version Python testing (3.8, 3.9, 3.10)
- Scans all Python files tracked by git
- Configurable via
.pylintrc,pyproject.toml, orsetup.cfg - Matrix strategy for version compatibility
Triggers: push (all branches)
Command:
pylint $(git ls-files '*.py')- Lint all Python files
See: pylint.md for detailed documentation
-
Copy the workflow file to your repository:
cp .github/workflow-templates/[workflow-name].yml .github/workflows/[workflow-name].yml
-
Read the documentation for prerequisites and setup:
cat .github/workflow-templates/[workflow-name].md
-
Configure prerequisites (e.g., create
.secrets.baseline, set up ESLint config, etc.) -
Customize the workflow (optional):
- Adjust trigger branches
- Modify versions (Node.js, Python, etc.)
- Update paths or commands
-
Commit and push - The workflow will run automatically based on its triggers
# Copy the workflow
cp .github/workflow-templates/eslint.yml .github/workflows/eslint.yml
# Ensure your project has ESLint and Prettier configured
# (see eslint.md for details)
# Commit and push
git add .github/workflows/eslint.yml
git commit -m "Add ESLint workflow"
git push| Workflow | Language | Package Manager | Trigger Events | Key Tools |
|---|---|---|---|---|
| detect-secrets | Python | pip | push, PR | detect-secrets 1.5.0 |
| eslint | JavaScript/TypeScript | Yarn | push, PR, manual | ESLint, Prettier |
| npm-test | JavaScript/TypeScript | npm | push, PR | npm, Codecov |
| pylint | Python | pip | push | Pylint |
Most workflows require:
- Repository access - Workflows run in the repository context
- Configuration files - Each workflow may need specific config files
- Dependencies - Project dependencies must be installable
- Secrets (optional) - Some workflows may need GitHub secrets (e.g.,
CODECOV_TOKEN)
Workflows can be customized to trigger on different events:
on:
push:
branches: [main, develop] # Customize branches
pull_request:
branches: [main]
workflow_dispatch: # Allow manual triggers-
Start with one workflow - Don't add all workflows at once. Start with the most critical for your project.
-
Read the documentation - Each workflow has detailed
.mddocumentation with setup instructions. -
Test locally first - Run the tools locally before adding the workflow to ensure they work.
-
Customize appropriately - Adjust versions, branches, and paths to match your project needs.
-
Monitor workflow runs - Check the Actions tab to ensure workflows run successfully.
Choose detect-secrets if:
- Your project handles sensitive data
- You want to prevent secret leaks
- You need security scanning
Choose eslint if:
- You have JavaScript/TypeScript code
- You want consistent code style
- You need automatic formatting
Choose npm-test if:
- You have a Node.js project
- You want automated testing
- You need coverage reporting
Choose pylint if:
- You have Python code
- You want code quality checks
- You need style enforcement
You can use multiple workflows together:
# Example: Full-stack project with Python backend and JS frontend
cp .github/workflow-templates/detect-secrets.yml .github/workflows/
cp .github/workflow-templates/pylint.yml .github/workflows/
cp .github/workflow-templates/eslint.yml .github/workflows/
cp .github/workflow-templates/npm-test.yml .github/workflows/Each workflow template includes comprehensive documentation:
- detect-secrets.md - Secret detection setup
- eslint.md - ESLint & Prettier configuration
- npm-test.md - Test suite setup
- pylint.md - Python linting configuration
Workflow not running:
- Check that the workflow file is in
.github/workflows/ - Verify trigger conditions (branches, events)
- Ensure the workflow file has valid YAML syntax
Workflow failing:
- Check the Actions tab for error messages
- Verify all prerequisites are met
- Review the workflow's documentation for troubleshooting tips
Configuration issues:
- Ensure required config files exist (
.secrets.baseline,.eslintrc, etc.) - Verify package.json scripts match workflow expectations
- Check that dependencies are properly installed
When adding or modifying workflow templates:
- Update both the
.ymland.mdfiles - Test the workflow in a sample repository
- Document any prerequisites clearly
- Include troubleshooting tips
- Keep versions up to date
- GitHub Actions Documentation
- Workflow Syntax Reference
- Profile README - Organization profile information
Note: These workflow templates are designed to be copied into individual repositories. They are not meant to be used directly from this repository.