RSS Feed Processor #281
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: RSS Feed Processor | |
| on: | |
| schedule: | |
| - cron: '0 */6 * * *' # Esecuzione ogni 6 ore | |
| workflow_dispatch: # Consente l'attivazione manuale | |
| jobs: | |
| process-feed: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Storia completa per operazioni git corrette | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.10' | |
| - name: Installa dipendenze | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install requests lxml | |
| - name: crea cartella utente bin, copia dentro l'eseguibile di mlr | |
| run: | | |
| mkdir -p "$HOME/bin" | |
| cp bin/mlr "$HOME/bin/mlr" | |
| chmod +x "$HOME/bin/mlr" | |
| echo "$HOME/bin" >> "$GITHUB_PATH" | |
| - name: Configura utente Git | |
| run: | | |
| git config --global user.name "GitHub Action" | |
| git config --global user.email "action@github.com" | |
| - name: Elabora feed RSS | |
| run: | | |
| chmod +x ./scripts/google_alert.py | |
| python ./scripts/google_alert.py | |
| - name: Esegui script di riepilogo | |
| run: | | |
| chmod +x ./scripts/summary.sh | |
| ./scripts/summary.sh | |
| - name: Commit e push in caso di modifiche | |
| run: | | |
| git add data/feed_entries.jsonl data/url_summary.csv | |
| if git diff --staged --quiet; then | |
| echo "Nessuna modifica da committare" | |
| else | |
| git commit -m "Aggiorna feed entries e riepilogo [skip ci]" | |
| git push | |
| fi |