-
Notifications
You must be signed in to change notification settings - Fork 0
28 lines (28 loc) · 1.02 KB
/
tempo.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
on:
schedule:
- cron: "30 8 * * *"
workflow_dispatch:
jobs:
get-tempo:
runs-on: self-hosted
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: GET EDF historicTEMPOStore 09-2023 - 09-2024
run: |
curl 'https://particulier.edf.fr/services/rest/referentiel/historicTEMPOStore?dateBegin=2023&dateEnd=2024' -o tempo_2024.json
- name: Merge tempo_*.json and tempo.json
run: |
jq -s 'map(.dates |= map(select(.couleur != "NON_DEFINI"))) | unique_by(.dates[].date) | { "dates": map(.dates[])}' tempo_2024.json tempo.json > tempo_new.json
jq ' .dates |= unique_by(.date) ' tempo_new.json > tempo_dedup.json
- name: Replace old tempo.json file
run: mv tempo_dedup.json tempo.json
- name: Cleanup
run: rm tempo_*.json
- name: Commit file
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Update tempo.json
branch: main
file_pattern: "tempo.json"