Skip to content

Fixes + Updated ads #126

Fixes + Updated ads

Fixes + Updated ads #126

Workflow file for this run

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