Skip to content

Commit

Permalink
cleanup 2
Browse files Browse the repository at this point in the history
  • Loading branch information
cameron-dunn-sublime committed Dec 27, 2023
1 parent bb8ded8 commit cea27ed
Showing 1 changed file with 28 additions and 28 deletions.
56 changes: 28 additions & 28 deletions .github/workflows/rule-validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,33 +61,33 @@ jobs:
pip install -r scripts/generate-rule-ids/requirements.txt
python scripts/generate-rule-ids/main.py
# - name: Validate Rules
# run: |
# for f in *-rules/*.yml
# do
# echo "Processing $f"
# http_code=$(yq -o=json eval 'del(.type)' "$f" | curl -H "Content-Type: application/json" -X POST --data-binary @- -o response.txt -w "%{http_code}" --silent https://playground.sublimesecurity.com/v1/rules/validate)
# echo '' >> response.txt
# cat response.txt
# if [[ "$http_code" != "200" ]]; then
# echo "Unexpected response $http_code"
# exit 1
# fi
# done
#
# - name: Validate Insights and Signals
# run: |
# for f in {insights,signals}/**/*.yml
# do
# echo "Processing $f"
# http_code=$(yq eval 'del(.type) | .source = "length([\n\n" + .source + "\n]) >= 0"' "$f" -o=json | curl -H "Content-Type: application/json" -X POST --data-binary @- -o response.txt -w "%{http_code}" --silent https://playground.sublimesecurity.com/v1/rules/validate)
# echo '' >> response.txt
# cat response.txt
# if [[ "$http_code" != "200" ]]; then
# echo "Unexpected response $http_code"
# exit 1
# fi
# done
- name: Validate Rules
run: |
for f in *-rules/*.yml
do
echo "Processing $f"
http_code=$(yq -o=json eval 'del(.type)' "$f" | curl -H "Content-Type: application/json" -X POST --data-binary @- -o response.txt -w "%{http_code}" --silent https://playground.sublimesecurity.com/v1/rules/validate)
echo '' >> response.txt
cat response.txt
if [[ "$http_code" != "200" ]]; then
echo "Unexpected response $http_code"
exit 1
fi
done
- name: Validate Insights and Signals
run: |
for f in {insights,signals}/**/*.yml
do
echo "Processing $f"
http_code=$(yq eval 'del(.type) | .source = "length([\n\n" + .source + "\n]) >= 0"' "$f" -o=json | curl -H "Content-Type: application/json" -X POST --data-binary @- -o response.txt -w "%{http_code}" --silent https://playground.sublimesecurity.com/v1/rules/validate)
echo '' >> response.txt
cat response.txt
if [[ "$http_code" != "200" ]]; then
echo "Unexpected response $http_code"
exit 1
fi
done
- name: Verify no .yaml files exist
run: |
Expand All @@ -101,7 +101,7 @@ jobs:
- name: Commit & Push Results, if needed
id: final_basic_validation
run: |
#rm response.txt
rm response.txt
if [ -z "$(git status --porcelain)" ]; then
echo "No files changed, nothing to do"
Expand Down

0 comments on commit cea27ed

Please sign in to comment.