diff --git a/.github/workflows/update_patterns.yml b/.github/workflows/update_patterns.yml index 91ff835..b3e211e 100644 --- a/.github/workflows/update_patterns.yml +++ b/.github/workflows/update_patterns.yml @@ -10,17 +10,17 @@ jobs: runs-on: ubuntu-latest steps: - - name: Checkout Repository + - name: ๐Ÿšš Checkout Repository uses: actions/checkout@v3 with: fetch-depth: 0 # Full history to avoid shallow clone issues - - name: Set Up Python + - name: โš™๏ธ Set Up Python uses: actions/setup-python@v4 with: python-version: '3.11' - - name: Cache Python Packages + - name: ๐Ÿ“ฆ Cache Python Packages id: cache-pip uses: actions/cache@v3 with: @@ -29,51 +29,50 @@ jobs: restore-keys: | ${{ runner.os }}-pip- - - name: Install Dependencies + - name: ๐Ÿ“ฅ Install Dependencies if: steps.cache-pip.outputs.cache-hit != 'true' run: | python -m pip install --upgrade pip - pip install requests beautifulsoup4 + pip install -r requirements.txt continue-on-error: false # Fail the workflow if dependencies fail to install - - name: Run OWASP Scraper + - name: ๐Ÿ•ท๏ธ Run OWASP Scraper run: | python owasp.py continue-on-error: false - - name: Convert OWASP to Caddy WAF + - name: ๐Ÿ”„ Convert OWASP to Caddy WAF run: | python owasp2caddy.py continue-on-error: false - - name: Convert OWASP to Nginx WAF + - name: ๐Ÿ”„ Convert OWASP to Nginx WAF run: | python owasp2nginx.py continue-on-error: false - - name: Check for Changes + - name: ๐Ÿ” Check for Changes id: git-check run: | git diff --quiet waf_patterns || echo "changes=true" >> $GITHUB_ENV - - name: Commit and Push Changes + - name: ๐Ÿš€ Commit and Push Changes if: env.changes == 'true' run: | git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" - git add waf_patterns/caddy/*.conf - git add waf_patterns/nginx/*.conf - git commit -m "Automated update: OWASP CRS to Caddy and NGinx WAF rules [$(date)]" + git add waf_patterns/caddy/*.conf waf_patterns/nginx/*.conf + git commit -m "Automated update: OWASP CRS to Caddy and Nginx WAF rules [$(date)]" git push - continue-on-error: true # Allow workflow to continue even if no changes + continue-on-error: true # Continue even if no changes are made - - name: Cleanup Cache (Optional) + - name: ๐Ÿงน Cleanup Cache (Optional) run: | rm -rf ~/.cache/pip if: always() # Run this step even if previous steps fail - - name: Notify on Failure (Optional) + - name: ๐Ÿšจ Notify on Failure (Optional) if: failure() run: | - echo "Workflow failed. Notify via Slack or Email." - # Add Slack webhook or email notification here + echo "๐Ÿšจ Workflow failed! Please investigate." + # Slack or email notification logic (add webhook or SMTP integration here)