mirror of
https://github.com/fabriziosalmi/patterns.git
synced 2025-12-17 17:55:48 +00:00
Update update_patterns.yml
This commit is contained in:
parent
d27e602eb2
commit
cf43e2a382
18
.github/workflows/update_patterns.yml
vendored
18
.github/workflows/update_patterns.yml
vendored
@ -66,13 +66,29 @@ jobs:
|
||||
python badbots.py
|
||||
continue-on-error: false
|
||||
|
||||
- name: 📊 Count Rules for Each Web Server
|
||||
id: count_rules
|
||||
run: |
|
||||
NGINX_RULES=$(grep -c '^' waf_patterns/nginx/*.conf || echo 0)
|
||||
APACHE_RULES=$(grep -c '^' waf_patterns/apache/*.conf || echo 0)
|
||||
TRAEFIK_RULES=$(grep -c '^' waf_patterns/traefik/*.conf || echo 0)
|
||||
HAPROXY_RULES=$(grep -c '^' waf_patterns/haproxy/*.conf || echo 0)
|
||||
echo "nginx_rules=$NGINX_RULES" >> $GITHUB_OUTPUT
|
||||
echo "apache_rules=$APACHE_RULES" >> $GITHUB_OUTPUT
|
||||
echo "traefik_rules=$TRAEFIK_RULES" >> $GITHUB_OUTPUT
|
||||
echo "haproxy_rules=$HAPROXY_RULES" >> $GITHUB_OUTPUT
|
||||
|
||||
# Ensure conf files are pushed even if no changes detected
|
||||
- name: 🚀 Commit and Push OWASP WAF patterns
|
||||
run: |
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git add .
|
||||
git commit -m "Update: [$(date)]" || echo "No changes to commit"
|
||||
git commit -m "Update: [$(date)]
|
||||
Nginx Rules: ${{ steps.count_rules.outputs.nginx_rules }}
|
||||
Apache Rules: ${{ steps.count_rules.outputs.apache_rules }}
|
||||
Traefik Rules: ${{ steps.count_rules.outputs.traefik_rules }}
|
||||
HAProxy Rules: ${{ steps.count_rules.outputs.haproxy_rules }}"
|
||||
git push
|
||||
continue-on-error: true # Continue even if no changes are made
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user