Update Python version to 3.12 in report.yaml workflow #17
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: Report Update | |
on: | |
schedule: | |
# First day of the month at 2:00 UTC is on BRL last day of the month at 23:00 | |
- cron: '0 2 1 * *' | |
workflow_dispatch: | |
- inputs: | |
- MONTH: | |
description: 'Month to generate the report' | |
required: true | |
default: 'last_month' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.12 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.12 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install poetry | |
- name: Poetry install | |
run: poetry install --no-dev --no-root | |
- name: Run report | |
run: | | |
poetry run python main.py ${{secrets.PROPERTY_ID}} $(bash calculate_dates.sh ${{ github.event.inputs.MONTH }}) | |
env: | |
SERVICE_ACCOUNT_CREDENTIALS: ${{ secrets.SERVICE_ACCOUNT_CREDENTIALS }} | |
PROPERTY_ID: ${{ secrets.PROPERTY_ID }} | |
- name: Commit and push changes | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "Codaqui Bot" | |
git add . | |
DATE=$(date +"%d-%m-%Y") | |
FIRST_DAY=$(date -d "-1 month" +%Y-%m-01) | |
git commit -m "Update report for $FIRST_DAY - $DATE" | |
git push origin HEAD:main |