Enhance workflow to validate all GitHub Actions workflow files #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Validates all workflow files on PR changes | |
name: Lint Workflow Files | |
on: | |
pull_request: | |
paths: | |
- '.github/workflows/**/*.yml' | |
jobs: | |
lint-workflows: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' | |
- name: Install yamllint | |
run: pip install yamllint | |
- name: Run YAML syntax check (do not fail on error) | |
run: | | |
yamllint .github/workflows/*.yml || echo "YAML lint errors detected, please fix all issues before merging." | |
- name: Run Actions-specific checks (do not fail on error) | |
uses: reviewdog/action-actionlint@v1 | |
continue-on-error: true | |
- name: Reminder to Fix Errors | |
run: echo "Please ensure all linting errors are addressed before merging the pull request." | |