mirror of
https://github.com/splunk/security_content
synced 2026-06-08 17:32:49 +00:00
11c909f725
* Add YAML formatting and validation infrastructure - Add yamlfmt configuration (.yamlfmt) with 4-space indent, LF line endings - Add yamllint configuration (.yamllint) for syntax validation (detections/ only) - Add pre-commit hook for automatic YAML formatting - Add CI validation script with unified error output - Add GitHub Actions workflow for PR validation - Add documentation for setup and usage - Support custom yamlfmt binary path via --yamlfmt-path flag * comment yaml check from pre-commit * apply yamlfmt * Update yaml-validation.yml * Update yaml-validation.yml * application folder search formatting * cloud folder search formatting * web folder search formatting * network folder search formatting * endpoint folder search formatting * resolve first conflict * apply formatting * remove additional pipe * Update README.md * update versions * restore and update formatting (#3920) --------- Co-authored-by: Bhavin Patel <bhavin.j.patel91@gmail.com>
46 lines
1003 B
YAML
46 lines
1003 B
YAML
name: YAML Validation
|
|
|
|
on:
|
|
pull_request:
|
|
paths:
|
|
- 'detections/**/*.yml'
|
|
- 'detections/**/*.yaml'
|
|
push:
|
|
branches:
|
|
- develop
|
|
paths:
|
|
- 'detections/**/*.yml'
|
|
- 'detections/**/*.yaml'
|
|
|
|
jobs:
|
|
validate:
|
|
name: Validate Detection YAML Files
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version: '3.11'
|
|
architecture: 'x64'
|
|
|
|
- name: Install yamllint
|
|
run: pip install yamllint
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v6
|
|
|
|
- name: Install yamlfmt
|
|
run: |
|
|
go install github.com/google/yamlfmt/cmd/yamlfmt@latest
|
|
echo "$HOME/go/bin" >> $GITHUB_PATH
|
|
|
|
- name: Validate all detection YAML files
|
|
run: |
|
|
python scripts/validate_yaml.py detections/
|