Convert #7130
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
# This is a basic workflow to help you get started with Actions | |
name: Convert | |
# Controls when the workflow will run | |
on: | |
# Triggers the workflow on push or pull request events but only for the "main" branch | |
schedule: | |
- cron: '0 */4 * * *' | |
workflow_dispatch: | |
permissions: write-all | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
build: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
permissions: | |
contents: | |
write | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v4 | |
# - name: Convert CERT List | |
# env: | |
# POWERSHELL_TELEMETRY_OPTOUT: 1 | |
# id: convert_list | |
# shell: pwsh | |
# run: | | |
# Remove-Item -Path .\domains_adblock_fixed.txt -Force | |
# Invoke-WebRequest -Uri "https://hole.cert.pl/domains/domains_adblock.txt" -OutFile .\domains_adblock.txt | |
# Set-Content -Path .\domains_adblock_fixed.txt -Value (Get-Content .\domains_adblock.txt).Replace("^`$all","^") -Force | |
# $version = (Get-Content .\domains_adblock.txt)[1] -replace ".*version:\s*([^\s]+).*",'$1' | |
# Write-Output "version=$($version)" >> $ENV:GITHUB_OUTPUT | |
- name: Install dependencies | |
run: | | |
npm i -g @adguard/hostlist-compiler | |
- name: Compile new list | |
run: | | |
hostlist-compiler -c configuration.json -o domains_adblock_fixed.txt | |
- name: Push new List | |
run: | | |
git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
git add domains_adblock_fixed.txt | |
git commit -a -m "Updated lists" | |
git push | |
git tag -a "v.$(date '+%Y%m%d%H%M')" -m "Add version $(date '+%Y%m%d%H%M')" | |
git push --follow-tags | |
gh release create v.$(date '+%Y%m%d%H%M') --latest | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- uses: dev-drprasad/delete-older-releases@v0.3.4 | |
name: Clean old releases | |
with: | |
keep_latest: 24 | |
delete_tags: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |