Build Filters AGH #6
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: Build Filters AGH | |
on: | |
# Schedule updates (4 hours) | |
schedule: [{cron: "0 */12 * * *"}] | |
# Lines below let you run workflow manually and on each commit | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.12 | |
cache: pip | |
- name: Install Python dependencies | |
run: pip install -r requirements.txt | |
- name: Establecer la identidad del usuario Git | |
run: | | |
git config --global user.name "${{ secrets.GIT_USER_NAME }}" | |
git config --global user.email "${{ secrets.GIT_USER_EMAIL }}" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Ejecutar script AGH_Whitelist.py | |
run: | | |
cd AGH/ | |
chmod +x AGH_Whitelist.py | |
python3 ./AGH_Whitelist.py | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Ejecutar script AGH_filters.py | |
run: | | |
cd AGH/ | |
chmod +x AGH_filters.py | |
python3 ./AGH_filters.py | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Aplicar cambios | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
git add AGH/hosts.txt | |
git add AGH/filters/whitelist/whitelist.txt | |
git commit -m "Actualizar archivos desde GitHub Actions" | |
git push origin main |