-
Notifications
You must be signed in to change notification settings - Fork 2
49 lines (39 loc) · 1.26 KB
/
report.yaml
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
name: Report Update
on:
schedule:
# Second day of the month UTC
- cron: '0 0 2 * *'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.12
uses: actions/setup-python@v3
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: |
DATE=$(date +"%d-%m-%Y")
FIRST_DAY=$(date -d "-1 month" +01-%m-%Y)
echo Running report for $FIRST_DAY - $DATE
cat ${{secrets.SERVICE_ACCOUNT_CREDENTIALS}} > service_account.json
poetry run python main.py ${{secrets.PROPERTY_ID}} $FIRST_DAY $DATE
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"