-
Notifications
You must be signed in to change notification settings - Fork 34
66 lines (54 loc) · 2.07 KB
/
actualizar-eventos-meetup.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
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 }}