diff --git a/.github/workflows/lint-workflow-files.yml b/.github/workflows/lint-workflow-files.yml new file mode 100644 index 00000000000..0b8e7571c2f --- /dev/null +++ b/.github/workflows/lint-workflow-files.yml @@ -0,0 +1,34 @@ +# 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." +