Add ogloszenia-ukrainek.pl #14
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: Update manually approved blocklists | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- '**.txt' | |
workflow_dispatch: | |
jobs: | |
update: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
ref: main | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22.x | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm ci | |
- name: Prepare templates | |
run: node scripts/prepare-templates.js | |
- name: Remove duplicates from templates | |
run: node scripts/remove-duplicates.js | |
- name: Remove domains that are on the whitelist | |
run: node scripts/whitelist.js | |
- name: Set valid encoding | |
run: node scripts/set-valid-encoding.js | |
- name: Count domains | |
run: node scripts/update-number-of-domains.js | |
- name: Generate No IP list | |
run: node scripts/generate/noip.js | |
- name: Generate 0.0.0.0 list | |
run: node scripts/generate/0.0.0.0.js | |
- name: Generate 127.0.0.1 list | |
run: node scripts/generate/127.0.0.1.js | |
- name: Generate AdGuard list | |
run: node scripts/generate/adguard.js | |
- name: Generate Dnsmasq list | |
run: node scripts/generate/dnsmasq.js | |
- name: Generate RPZ list | |
run: node scripts/generate/rpz.js | |
- name: Generate list for Unbound | |
run: node scripts/generate/unbound.js | |
- name: Run git pull | |
run: git pull origin main | |
- name: Add files to staging | |
run: git add . | |
- name: Commit and push changes | |
run: | | |
git config user.name "Sefinek Actions" | |
git config user.email "[email protected]" | |
if [ -n "$(git status -s)" ]; then | |
MODIFIED_FILES=$(git diff --name-only HEAD | grep -v '^cache/') | |
FILE_COUNT=$(echo "$MODIFIED_FILES" | wc -l) | |
if [ "$FILE_COUNT" -gt 0 ]; then | |
git commit -am "Update previously committed blocklists in $GITHUB_SHA [$FILE_COUNT files]" -m "$MODIFIED_FILES" | |
git push origin main | |
else | |
echo "Canceled. No files to commit after excluding cache/ files." | |
fi | |
else | |
echo "Canceled. No changes to commit." | |
fi |