NoAds UPD #415
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: NoAds UPD | |
on: | |
schedule: | |
- cron: '30 3 * * *' | |
push: | |
paths: | |
- 'contrib/upd_exclude' | |
workflow_dispatch: | |
jobs: | |
noads_upd: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
- name: Set Timezone | |
uses: szenius/set-timezone@v1.1 | |
with: | |
timezoneLinux: "Europe/Rome" | |
- name: Set date and time | |
run: sh ./sh/datetime.sh | |
- name: Prepare list header | |
run: | | |
echo "! Title: X Files: UPD uBlock Phishing Domains" > upd.txt | |
echo "! Version:" $update >> upd.txt | |
echo "! Last modified:" $lastmodified >> upd.txt | |
echo "! Expires: 1 day (update frequency)" >> upd.txt | |
echo "!" >> upd.txt | |
echo "! uBlock Phishing Domains blocca siti web dannosi per la tua navigazione" >> upd.txt | |
echo "! Una lista specificatamente pensata per uBlock Origin, ANCORA IN FASE DI SPERIMENTAZIONE" >> upd.txt | |
echo "!" >> upd.txt | |
echo "! Homepage: https://xfiles.noads.it" >> upd.txt | |
echo "! Blog: https://go.gioxx.org/noads" >> upd.txt | |
echo "! Database: https://github.com/mitchellkrogza/Phishing.Database" >> upd.txt | |
echo "! Hosting: github.com" >> upd.txt | |
echo "!" >> upd.txt | |
- name: Make UPD | |
run: sh ./sh/make_upd.sh | |
- name: Prepare vCheck | |
if: ${{ env.stop == 'false' }} | |
run: | | |
num_of_lines=$(< "upd.txt" wc -l) | |
num_of_lines="$((num_of_lines - 13))" | |
md5=($(md5sum upd.txt| cut -d ' ' -f 1)) | |
echo $update > vcheck/check_upd.txt | |
echo $lastmodified >> vcheck/check_upd.txt | |
echo $checkwebsite >> vcheck/check_upd.txt | |
echo $num_of_lines >> vcheck/check_upd.txt | |
echo $md5 >> vcheck/check_upd.txt | |
- name: Run CommitsWithinTime script | |
uses: AlexHolderDeveloper/CommitsWithinTime@v1.1.11 | |
id: commitswithintime | |
- name: Get the output from CommitsWithinTime | |
if: ${{ env.stop == 'false' }} | |
run: | | |
echo ${{ steps.commitswithintime.outputs.total-commits }} > vcheck/check_gh.txt | |
- name: Commit UPD | |
run: | | |
git config --local user.email "114237374+GWall-bot@users.noreply.github.com" | |
git config --local user.name "GWall[bot]" | |
git add upd.txt | |
git add vcheck/check_upd.txt | |
git add vcheck/check_gh.txt | |
git commit -m "Aggiornamento UPD (GHA) $update del $lastmodified" -a | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: ${{ github.ref }} |