Files

31 lines
677 B
YAML

name: rules
on:
push:
branches: [main]
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- run: pip install semgrep
- name: Validate
run: |
for f in *.yaml; do
semgrep --validate --metrics=off --config "$f"
done
- name: Test
run: |
rc=0
for t in tests/*; do
rules="$(basename "${t%.*}").yaml"
echo "== $t -> $rules"
semgrep --test --metrics=off --config "$rules" "$t" || rc=1
done
exit $rc