-
-
Notifications
You must be signed in to change notification settings - Fork 12.1k
45 lines (38 loc) · 1.08 KB
/
ads.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: Remove Ads
on:
push:
branches:
- main
jobs:
update-Ad-Free:
runs-on: ubuntu-latest
steps:
- name: Checkout main branch
uses: actions/checkout@v2
with:
ref: main
- name: Remove Ads
run: |
git fetch origin
if git branch --list | grep -q 'Ad-Free'; then
git checkout Ad-Free
git pull origin Ad-Free
git merge main --no-edit
else
git checkout -b Ad-Free
fi
- name: Remove first 9 lines from m.js
run: |
sed -i '1,9d' static/assets/js/m.js
- name: Commit changes
env:
GIT_USERNAME: ${{ secrets.GIT_USERNAME }}
GIT_EMAIL: ${{ secrets.GIT_EMAIL }}
run: |
git config --global user.name "${GIT_USERNAME}"
git config --global user.email "${GIT_EMAIL}"
git add static/assets/js/m.js
git commit -m "Remove specific JS code from m.js"
- name: Push changes to Ad-Free branch
run: |
git push origin Ad-Free --force