File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Validate Workflows
2+
3+ on :
4+ push :
5+ paths :
6+ - " .github/workflows/**/*.yml"
7+ - " .github/workflows/**/*.yaml"
8+ pull_request :
9+ paths :
10+ - " .github/workflows/**/*.yml"
11+ - " .github/workflows/**/*.yaml"
12+
13+ jobs :
14+ validate :
15+ name : Lint & Schema Validate Workflows
16+ runs-on : ubuntu-latest
17+
18+ steps :
19+ - name : Checkout repository
20+ uses : actions/checkout@v4
21+
22+ # Step 1: Run actionlint for logic/deprecation checks
23+ - name : Run actionlint
24+ uses : raven-actions/actionlint@v1
25+
26+ # Step 2: Set up Python for schema validation
27+ - name : Set up Python
28+ uses : actions/setup-python@v5
29+ with :
30+ python-version : " 3.x"
31+
32+ - name : Install check-jsonschema
33+ run : pip install check-jsonschema
34+
35+ # Step 3: Validate each workflow YAML file against schema
36+ - name : Validate against GitHub workflow schema
37+ run : |
38+ for file in $(find .github/workflows -name "*.y*ml"); do
39+ echo "Validating $file..."
40+ check-jsonschema \
41+ --schemafile https://json.schemastore.org/github-workflow.json \
42+ "$file"
43+ done
You can’t perform that action at this time.
0 commit comments