NoAds UPD Domains Only #1420
This file contains hidden or 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 Domains Only | |
| on: | |
| schedule: | |
| - cron: '55 3 * * *' | |
| push: | |
| paths: | |
| - 'contrib/upd_exclude' | |
| workflow_dispatch: | |
| jobs: | |
| noads_domains: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v7.0.0 | |
| with: | |
| fetch-depth: 1 | |
| - name: Sleep Action | |
| if: github.event_name == 'schedule' | |
| uses: juliangruber/sleep-action@v2.0.4 | |
| with: | |
| time: 2m | |
| - name: Set Timezone | |
| uses: szenius/set-timezone@v2.0 | |
| with: | |
| timezoneLinux: "Europe/Rome" | |
| - name: Set date and time | |
| run: bash ./sh/parts/datetime.sh | |
| - name: Install dependencies | |
| run: sudo apt-get update && sudo apt-get install -y jq | |
| - name: Generate UPD Domains | |
| run: bash ./sh/make_domains.sh | |
| - name: Prepare vCheck | |
| if: env.stop != 'true' | |
| run: | | |
| num_of_lines=$(grep -v '^! ' "domains/upd_domains.txt" | wc -l) | |
| md5=$(md5sum domains/upd_domains.txt | cut -d ' ' -f 1) | |
| cat <<EOF > vcheck/check_domains.txt | |
| $update | |
| $lastmodified | |
| $checkwebsite | |
| $num_of_lines | |
| $md5 | |
| EOF | |
| - name: Commit UPD Domains | |
| if: env.stop != 'true' | |
| run: | | |
| git config --local user.name "GWall[bot]" | |
| git config --local user.email "114237374+GWall-bot@users.noreply.github.com" | |
| git add domains/upd_domains.txt vcheck/check_domains.txt | |
| git diff --cached --quiet || git commit -m "Aggiornamento UPD Domains (GHA) $update del $lastmodified" | |
| - name: Push changes | |
| if: env.stop != 'true' | |
| uses: ad-m/github-push-action@master | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| branch: ${{ github.ref }} |