The CI/CD pipeline workflow (ci.yml) automatically validates, tests, and ensures quality standards for all workflows in this repository. It runs on every push and pull request to the master or main branch.
- ✅ YAML Syntax Validation - Validates all workflow YAML files for correct syntax
- 🧹 YAML Linting - Enforces consistent YAML formatting and style
- 🔍 Workflow Structure Validation - Ensures all workflows have required fields
- 🔒 Security Scanning - Checks for security vulnerabilities and hardcoded secrets
- 📚 Documentation Validation - Verifies documentation exists and links are valid
- 🏷️ Naming Convention Check - Ensures workflows follow naming standards
- 🔍 Actionlint - Advanced GitHub Actions workflow validation
⚠️ Deprecated Actions Check - Warns about outdated action versions- 🔐 Permission Validation - Reviews workflow permissions for security
- Push to
masterormainbranch - Pull Request to
masterormainbranch - Manual Dispatch via GitHub Actions UI
- Validates all
.github/workflows/*.ymlfiles using Python's YAML parser - Ensures files are syntactically correct and can be parsed
- Runs
yamllintwith custom configuration (.yamllint.yml) - Checks indentation, line length, trailing spaces, and formatting
- Reports warnings and errors for style issues
- Checks that all workflows have required fields (
name,jobs) - Validates reusable workflows have proper
workflow_callconfiguration - Ensures workflows follow GitHub Actions best practices
- Runs TFSec and Checkov security scanners
- Checks for hardcoded secrets (passwords, API keys)
- Identifies security vulnerabilities in workflow configurations
- Uses
soft_fail: trueto report issues without failing the build
- Ensures every workflow has corresponding documentation in
docs/ - Validates all links in
README.mdpoint to existing files - Checks documentation completeness
- Verifies workflows follow prefix-based naming conventions:
tf-*- Terraform workflowscf-*- CloudFormation workflowspr-*- Pull Request workflowsaws-*- AWS-specific workflowsgcp-*- GCP-specific workflowssecurity-*- Security workflowsrelease-*- Release workflowsnotify-*- Notification workflowsdocker-*- Docker workflowshelm-*- Helm workflowsyml-*- YAML lint workflows
- Advanced GitHub Actions workflow validator
- Checks for common mistakes, deprecated features, and best practices
- Reports findings as PR review comments
- Scans for outdated action versions
- Warns about actions that should be updated (e.g.,
actions/checkout@v1)
- Reviews workflow permissions for security
- Ensures workflows request only necessary permissions
- Runs only on pushes to
masterbranch - Generates
WORKFLOW_INDEX.mdwith categorized workflow list - Uploads index as artifact
- Aggregates results from all jobs
- Creates a summary report in GitHub Actions UI
- Displays statistics about workflows and documentation
The repository includes a .yamllint.yml configuration file that defines linting rules:
rules:
line-length:
max: 500
level: warning
indentation:
level: error
trailing-spaces:
level: error
# ... more rulesThe workflow requires the following permissions:
contents: read- To read repository filespull-requests: write- To comment on PRs (actionlint)checks: write- To create check runs
The CI/CD pipeline runs automatically. No manual configuration is required.
To validate workflows locally before pushing:
# Install Python dependencies
pip install pyyaml
# Validate YAML syntax
for file in .github/workflows/*.yml; do
python3 -c "import yaml, sys; yaml.safe_load(open('$file'))"
done
# Install yamllint
pip install yamllint
# Run linting
yamllint .github/workflows/-
YAML Syntax Errors
- Check indentation (use 2 spaces, not tabs)
- Ensure proper key-value pairs
- Verify quotes around strings with special characters
-
Linting Errors
- Remove trailing spaces
- Add newline at end of file
- Fix indentation issues
-
Security Warnings
- Replace hardcoded values with
secrets.*references - Review permissions and minimize scope
- Update deprecated actions
- Replace hardcoded values with
-
Documentation Issues
- Create missing documentation files
- Fix broken links in README.md
- Ensure workflow names match documentation filenames
- Run CI Locally First - Validate changes before pushing
- Fix Warnings - Don't ignore linting warnings
- Keep Actions Updated - Regularly update action versions
- Document Changes - Update docs when modifying workflows
- Review Security - Pay attention to security scan results
- YAML Lint Workflow - Standalone YAML linting workflow
- YAML Lint Internal Workflow - Internal YAML validation
- Check for syntax errors in the workflow file
- Verify indentation is correct (2 spaces)
- Ensure all quotes are properly closed
- Review the specific finding
- Some warnings may be acceptable (e.g., public URLs)
- Use
soft_fail: trueto continue on warnings
- Create missing documentation files
- Fix broken links in README.md
- Ensure filenames match between workflows and docs
When adding new workflows:
- Ensure they pass all CI checks
- Create corresponding documentation
- Follow naming conventions
- Update README.md with links
- Test locally before submitting PR