-
Notifications
You must be signed in to change notification settings - Fork 480
feat(ci): Add comprehensive workflow linting and YAML autofo (#33871) #33872
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat(ci): Add comprehensive workflow linting and YAML autofo (#33871) #33872
Conversation
Implementation SummaryThis PR implements a complete workflow linting infrastructure with auto-formatting capabilities. 🎯 Key Features1. Linting Infrastructure
2. Auto-Formatting System
3. Pre-Commit Hook Enhancements (
|
This commit establishes a complete workflow linting infrastructure with auto-formatting capabilities to ensure high-quality, consistent GitHub Actions workflows and prevent syntax errors from being merged. - Add yamllint for YAML syntax validation (.yamllint config) - Add actionlint for GitHub Actions semantic validation (.github/actionlint.yaml) - Add mise.toml configuration for tool management - Add comprehensive linting strategy documentation (docs/core/LINTING_STRATEGY.md) - Add .prettierrc.yml for workflow-specific formatting rules - Integrate prettier auto-formatting into pre-commit hook - Two-tier validation: prettier (auto-fix) → yamllint (validate) - Format all 55 workflow and action files to establish clean baseline - Auto-format YAML files before validation - Run yamllint and actionlint on staged workflow files - Graceful degradation when tools are missing - Re-stage auto-formatted files automatically - Add workflow-lint job to PR validation (cicd_1-pr.yml) - Conditional execution based on workflow file changes - Update change detection filters (.github/filters.yaml) - Update initialize phase to detect workflow changes - Fix all script injection vulnerabilities (use env vars for untrusted input) - Update deprecated actions (checkout@v3→v4, setup-python@v4→v5, etc.) - Update custom actions from node16 to node20 - Fix undefined inputs and invalid references - Fix input default values not matching options - Remove trailing spaces (76 instances) - Normalize spacing and indentation across all workflows - Update docs/core/CICD_PIPELINE.md with workflow linting section - Add docs/core/LINTING_STRATEGY.md (comprehensive 640-line guide) - Complete linting strategy review across all layers - Git hook, frontend, backend, and CI/CD linting analysis - Gap analysis and recommendations for backend Java linting - Migration strategy for enabling additional linting tools ✅ 0 actionlint errors (all 47 issues fixed) ✅ 0 yamllint errors (all formatting issues resolved)⚠️ 108 yamllint warnings (acceptable line-length issues for URLs/JSON/bash) - **Prevention**: Catches workflow errors before merge - **Automation**: Auto-fixes formatting issues before commit - **Consistency**: Ensures uniform YAML formatting across project - **Speed**: Developers get immediate feedback locally - **Quality**: Reduces manual code review overhead - **Security**: Detects script injection vulnerabilities - **Maintenance**: Identifies deprecated actions and patterns This lays the foundation for preventing workflow syntax errors and establishes best practices for maintaining GitHub Actions workflows. 🤖 Generated with Claude Code (https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
05a6319 to
c594d32
Compare
|
This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
Description
Implements comprehensive workflow linting with yamllint and actionlint, adds prettier auto-formatting for YAML files, integrates with pre-commit hooks and CI/CD pipeline. Establishes clean formatting baseline for all 55+ workflow files with 47 actionlint issues resolved, including script injection fixes, deprecated action updates, and node16→node20 migration.
Changes
Testing
Closes #33871
Issue: Add comprehensive workflow linting and YAML autofo