This workflow automatically validates YAML files on pull requests by calling the reusable YAML Lint workflow. It's designed for internal use within repositories to ensure YAML files meet quality standards before merging.
The YAML Lint Internal workflow is a simple wrapper that triggers the reusable YAML Lint Workflow on pull requests. It provides an easy way to enforce YAML quality standards without requiring manual workflow configuration.
- ✅ Automatic Validation - Runs automatically on every pull request
- 🔄 Reuses Main Workflow - Calls the reusable
yml-lint.ymlworkflow - 🎯 Zero Configuration - Works out of the box with default settings
- 📋 PR Integration - Provides feedback directly in pull requests
Simply add this workflow to your repository's .github/workflows/ directory:
name: YAML-LINTER
on: [pull_request]
jobs:
YAML-LINTER:
uses: clouddrove/github-shared-workflows/.github/workflows/yml-lint.yml@v2---
name: YAML-LINTER
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
YAML-LINTER:
uses: clouddrove/github-shared-workflows/.github/workflows/yml-lint.yml@v2Use this workflow when you want:
- Automatic YAML Validation - No need to manually call the lint workflow
- PR Quality Gates - Ensure all YAML files are valid before merging
- Simple Setup - Minimal configuration required
- Consistent Standards - Enforce YAML formatting across the repository
- Trigger: Automatically runs on pull request events
- Validation: Calls the reusable
yml-lint.ymlworkflow - Feedback: Provides check results in the PR status
- Failure: PR checks will fail if YAML files have linting errors
This workflow can be combined with other validation workflows:
name: 'Complete PR Validation'
on:
pull_request:
jobs:
# YAML validation
yaml-lint:
uses: clouddrove/github-shared-workflows/.github/workflows/yml-lint-internal.yml@v2
# Terraform validation
terraform-checks:
uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@v2
with:
working_directory: terraform/
# Security scanning
security-scan:
uses: clouddrove/github-shared-workflows/.github/workflows/security-checkov.yml@v2If you need to customize the linting behavior, you have two options:
Instead of using yml-lint-internal.yml, call yml-lint.yml directly with custom configuration:
name: 'Custom YAML Lint'
on:
pull_request:
jobs:
yaml-lint:
uses: clouddrove/github-shared-workflows/.github/workflows/yml-lint.yml@v2
# Add any custom steps or configuration hereFork the workflow and modify it to meet your specific needs:
name: YAML-LINTER
on:
pull_request:
branches: [main, master, develop] # Customize branches
jobs:
YAML-LINTER:
uses: clouddrove/github-shared-workflows/.github/workflows/yml-lint.yml@v2
# Add additional steps if neededEnsure all workflow files are properly formatted:
# This workflow will validate .github/workflows/*.yml files
name: YAML-LINTER
on: [pull_request]
jobs:
YAML-LINTER:
uses: clouddrove/github-shared-workflows/.github/workflows/yml-lint.yml@v2Validate configuration files like docker-compose.yml, k8s manifests, etc.:
name: YAML-LINTER
on: [pull_request]
jobs:
YAML-LINTER:
uses: clouddrove/github-shared-workflows/.github/workflows/yml-lint.yml@v2Ensure YAML frontmatter in documentation files is valid:
name: YAML-LINTER
on: [pull_request]
jobs:
YAML-LINTER:
uses: clouddrove/github-shared-workflows/.github/workflows/yml-lint.yml@v2Solution: Check that:
- The workflow file is in
.github/workflows/directory - The file has
.ymlor.yamlextension - The workflow syntax is correct
- Pull requests are targeting the correct branch
Solution:
- Review the specific linting rule that's failing
- Some rules can be adjusted by modifying the reusable workflow
- Consider if the rule violation is acceptable for your use case
Solution:
- Fix errors incrementally
- Start with syntax errors first
- Then address formatting issues
- Use a YAML formatter to fix indentation automatically
- Enable Early - Add this workflow from the start of your project
- Fix Issues Promptly - Don't let YAML errors accumulate
- Use Editor Plugins - Install YAML linting plugins in your editor
- Document Exceptions - If you need to disable certain rules, document why
- Regular Updates - Keep the workflow version updated to get latest improvements
- YAML Lint Workflow - The reusable workflow this wraps
- CI/CD Pipeline - Comprehensive validation including YAML linting
- PR Checks - Additional PR validation workflows