Skip to content

.github/workflows/tempo.yml #249

.github/workflows/tempo.yml

.github/workflows/tempo.yml #249

Workflow file for this run

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"