Delete ruleset-domain-аntifilter_community_edition.srs #21
This file contains 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: Generate and Update AdAway/Torrents Lists | |
on: | |
push: | |
branches: [ main ] | |
schedule: | |
- cron: '0 1 * * *' # Weekly on Sundays (UTC) | |
permissions: | |
contents: write | |
jobs: | |
generate_lists: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Pull Changes | |
run: git pull | |
- name: Set up Node.js (if required) | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' # Adjust if needed | |
- name: Install Dependencies | |
run: | | |
sudo apt update | |
sudo apt install -y curl wget git | |
- name: Download generate-geoip-geosite | |
run: | | |
DOWNLOAD_URL=$(curl -s https://api.github.com/repos/Dunamis4tw/generate-geoip-geosite/releases/latest | grep "generate-geoip-geosite.*linux-amd64.tar.gz" | grep "browser_download_url" | cut -d '"' -f 4) | |
wget "$DOWNLOAD_URL" || exit 1 # Exit if download fails | |
- name: Extract generate-geoip-geosite | |
run: | | |
DOWNLOAD_URL=$(curl -s https://api.github.com/repos/Dunamis4tw/generate-geoip-geosite/releases/latest | grep "generate-geoip-geosite.*linux-amd64.tar.gz" | grep "browser_download_url" | cut -d '"' -f 4) | |
ARCHIVE_NAME=${DOWNLOAD_URL##*/} | |
wget "$DOWNLOAD_URL" | |
tar -xf "$ARCHIVE_NAME" | |
rm "$ARCHIVE_NAME" | |
- name: Create adaway_alive_hosts_mail_fb.json | |
run: | | |
cat << EOF > adaway_alive_hosts_mail_fb.json | |
[ | |
{ | |
"url": "https://schakal.ru/hosts/alive_hosts_mail_fb.txt", | |
"contentType": "HostsFile", | |
"category": "adaway_alive_hosts_mail_fb" | |
} | |
] | |
EOF | |
- name: Create torrents.json | |
run: | | |
cat << EOF > torrents.json | |
[ | |
{ | |
"url": "https://raw.githubusercontent.com/im-sm/Pi-hole-Torrent-Blocklist/main/all-torrent-trackres.txt", | |
"contentType": "DefaultList", | |
"category": "torrent_trackres" | |
}, | |
{ | |
"url": "https://raw.githubusercontent.com/im-sm/Pi-hole-Torrent-Blocklist/main/all-torrent-websites.txt", | |
"contentType": "DefaultList", | |
"category": "torrent_websites" | |
} | |
] | |
EOF | |
- name: Create Antifilter.Download community edition.json | |
run: | | |
cat << EOF > аntifilter.json | |
[ | |
{ | |
"url": "https://community.antifilter.download/list/domains.lst", | |
"contentType": "DefaultList", | |
"category": "аntifilter_community_edition" | |
} | |
] | |
EOF | |
- name: Make generate-geoip-geosite executable | |
run: chmod +x generate-geoip-geosite | |
- name: Generate AdAway Lists | |
run: | | |
./generate-geoip-geosite -s adaway_alive_hosts_mail_fb.json -i adaway -o adaway --gen-rule-set-srs | |
- name: Generate Torrents Lists | |
run: | | |
./generate-geoip-geosite -s torrents.json -i torrents -o torrents --gen-rule-set-srs | |
- name: Generate аntifilter_community_edition Lists | |
run: | | |
./generate-geoip-geosite -s аntifilter.json -i аntifilter -o аntifilter --gen-rule-set-srs | |
- name: Copy .srs files to repository directory | |
run: | | |
cp ./adaway/*.srs /home/runner/work/RuRulesets/RuRulesets | |
cp ./torrents/*.srs /home/runner/work/RuRulesets/RuRulesets | |
cp ./аntifilter/*.srs /home/runner/work/RuRulesets/RuRulesets | |
- name: Get current date | |
id: date | |
run: | | |
echo "DATE=$(TZ=Europe/Moscow date +'%Y-%m-%dT%H:%M:%S')" >> $GITHUB_ENV | |
- name: Commit and Push Changes | |
uses: EndBug/add-and-commit@v9 | |
with: | |
add: '*.srs' | |
author_name: GitHub Action | |
author_email: [email protected] | |
message: 'Update AdAway and Torrents Lists ${{ env.DATE }}' | |
push: true | |
cwd: . | |
default_author: github_actor | |
fetch: --tags --force | |
pathspec_error_handling: ignore | |
github_token: ${{ secrets.RULESET_TOKEN }} |