Actualizar eventos meetup #31
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@v3 | |
uses: actions/checkout@v3 | |
with: | |
ref: master | |
- name: setup-python@v4 | |
uses: actions/setup-python@v4 | |
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: Rama actual | |
run: git branch | |
- name: Git pull | |
run: git pull origin master | |
- 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 "[email protected]" | |
git checkout -b actualizar-eventos-${{ steps.date.outputs.date }} | |
git add databags/meetup.json | |
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 }} |