Actualizar eventos meetup #60
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: "Actualizar eventos meetup" | |
on: | |
schedule: | |
- cron: "0 12 * * 2" # Todos los martes a las 12:00 | |
workflow_dispatch: | |
jobs: | |
build: | |
if: github.repository_owner == 'PyBAQ' | |
name: Actualizar eventos meetup | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout@v4 | |
uses: actions/checkout@v4 | |
- name: setup-python@v5 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- name: Instalar requirements | |
run: | | |
python -m pip install --upgrade pip setuptools | |
pip install -r requirements.txt | |
- name: Ejecutar events.py | |
run: python scripts/events.py | |
- name: Ejecutar create_events.py | |
run: python scripts/create_events.py | |
- name: Rama actual | |
run: git branch | |
- name: Verificar cambios en archivo json | |
id: check_changes | |
run: | | |
if git diff --quiet --exit-code -- databags/meetup.json; then | |
echo "HAS_CHANGES=false" >> "$GITHUB_OUTPUT" | |
echo "No hay cambios en meetup.json" | |
else | |
echo "HAS_CHANGES=true" >> "$GITHUB_OUTPUT" | |
fi | |
- name: Obtener la fecha y hora | |
id: date | |
run: echo "date=$(date +'%Y%m%d-%H%M%S')" >> "$GITHUB_OUTPUT" | |
- name: Git crear rama y commit | |
if: steps.check_changes.outputs.HAS_CHANGES == 'true' | |
run: | | |
git config --global user.name "PyBaq Bot" | |
git config --global user.email "contacto@pybaq.co" | |
git checkout -b actualizar-eventos-${{ steps.date.outputs.date }} | |
git add databags/meetup.json | |
git add content/eventos | |
git commit -m "Actualizacion eventos meetup" | |
git push -u origin actualizar-eventos-${{ steps.date.outputs.date }} | |
- name: Crear pull request | |
if: steps.check_changes.outputs.HAS_CHANGES == 'true' | |
run: gh pr create -B master -H actualizar-eventos-${{ steps.date.outputs.date }} --title 'Actualizar eventos meetup into master' --body 'Created by PyBaq Bot' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |