From 884bcf656cad7fbd104f10e95104fb6b9fb82ff8 Mon Sep 17 00:00:00 2001 From: None <62809003+Arrowar@users.noreply.github.com> Date: Sat, 31 May 2025 10:59:11 +0200 Subject: [PATCH] Create update_domain.yml --- .github/workflows/update_domain.yml | 48 +++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/update_domain.yml diff --git a/.github/workflows/update_domain.yml b/.github/workflows/update_domain.yml new file mode 100644 index 0000000..3d7a0bc --- /dev/null +++ b/.github/workflows/update_domain.yml @@ -0,0 +1,48 @@ +name: Aggiorna Domini Periodicamente + +on: + schedule: + - cron: "*/45 * * * *" + workflow_dispatch: + +jobs: + update-domains: + runs-on: ubuntu-latest + permissions: + contents: write + + steps: + - name: Checkout del codice + uses: actions/checkout@v4 + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: '3.12' + + - name: Installa dipendenze + run: pip install httpx ua-generator + + - name: Configura DNS + run: | + sudo sh -c 'echo "nameserver 9.9.9.9" > /etc/resolv.conf' + sudo sh -c 'echo "nameserver 149.112.112.122" >> /etc/resolv.conf' + cat /etc/resolv.conf + + - name: Esegui lo script di aggiornamento domini + run: python domain_updater.py + + - name: Commit e Push delle modifiche (se presenti) + run: | + git config --global user.name 'github-actions[bot]' + git config --global user.email 'github-actions[bot]@users.noreply.github.com' + + # Controlla se domain.json รจ stato modificato + if ! git diff --quiet domain.json; then + git add domain.json + git commit -m "Aggiornamento automatico domini [skip ci]" + echo "Modifiche committate. Tentativo di push..." + git push + else + echo "Nessuna modifica a domain.json da committare." + fi