Fixes + Updated ads #126
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Remove Ads | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| update-ad-free: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set git identity | |
| run: | | |
| git config --global user.name "github-actions[bot]" | |
| git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
| - name: Setup Ad-Free branch | |
| run: | | |
| git fetch origin main | |
| if git ls-remote --heads origin Ad-Free; then | |
| git checkout Ad-Free | |
| git merge origin/main --no-edit | |
| else | |
| git checkout -b Ad-Free origin/main | |
| fi | |
| - name: Remove ad script block from m1.js | |
| run: | | |
| sed -i '/const blockedHostnames/,/^\s*}\s*$/d' static/assets/js/m1.js | |
| - name: Commit changes | |
| run: | | |
| if git diff --quiet; then | |
| echo "No changes detected" | |
| else | |
| git add static/assets/js/m1.js | |
| git commit -m "Remove ad injection block from m1.js" | |
| fi | |
| - name: Push changes | |
| run: git push origin Ad-Free --force |