Skip to content

Copy Release Blacklist to repo #21

Copy Release Blacklist to repo

Copy Release Blacklist to repo #21

name: Copy Release Blacklist to gh-pages
on:
schedule:
- cron: '0 * * * *' # Run every hour, you can adjust the schedule as needed
workflow_dispatch:
jobs:
copy-release-blacklist:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Download the latest blacklist.txt
run: |
wget -O latest_blacklist.txt https://github.com/fabriziosalmi/blacklists/releases/latest/download/blacklist.txt
continue-on-error: true
- name: Check if the file has changed
id: check_changes
run: |
if ! cmp -s latest_blacklist.txt blacklist.txt; then
mv latest_blacklist.txt blacklist.txt
echo "File updated, copying to gh-pages"
else
echo "File not updated, no action needed"
exit 1
fi
continue-on-error: true
- name: Commit and push changes to gh-pages
if: steps.check_changes.outcome == 'success'
run: |
git config user.name "GitHub Actions"
git config user.email "[email protected]"
git add blacklist.txt
git commit -m "Update blacklist.txt"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}