Merge the Firebog ticklist into one file #576
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: "Merge the Firebog ticklist into one file" | |
on: | |
schedule: | |
- cron: '0 0 * * *' | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
jobs: | |
main: | |
runs-on: "ubuntu-latest" | |
steps: | |
- uses: "actions/checkout@main" | |
- name: "Merge the Firebog ticklist into a single output file" | |
run: | | |
echo -e 'Automatic hosts update\n' >> output.txt | |
echo 'Sources:' >> output.txt | |
for URL in $(curl -s 'https://v.firebog.net/hosts/lists.php?type=tick'); do | |
curl -s "${URL}" | sed 's/\(0\.0\.0\.0\|127\.0\.0\.1\|::1\)\s*//g' | sed 's/\s*#.*//g' | sed '/^localhost$/d' | sed '/^$/d' >> firebog-ticked-hosts.tmp | |
echo " - '${URL}'" >> output.txt | |
done | |
sort firebog-ticked-hosts.tmp | uniq | sed 's/^/0.0.0.0 /g' | tail -n +2 > firebog-ticklist-hosts.txt | |
rm firebog-ticked-hosts.tmp | |
rm output.txt | |
- name: Commit changes | |
uses: EndBug/add-and-commit@main | |
with: | |
default_author: github_actions | |
message: ${{ env.MSG }} | |
- name: Delete workflow runs | |
uses: Mattraks/delete-workflow-runs@main | |
with: | |
token: ${{ github.token }} | |
repository: ${{ github.repository }} | |
retain_days: 1 | |
keep_minimum_runs: 1 | |
# EOF |