Update OE Outage Data #237
This file contains hidden or 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: Update OE Outage Data | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "17 */6 * * *" | |
| permissions: | |
| contents: write | |
| jobs: | |
| update-outage-data: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Generate outage export | |
| run: python ./tools/export_oe_outage_data.py | |
| - name: Detect changes | |
| id: diff | |
| shell: bash | |
| run: | | |
| if git diff --quiet -- data/Ternopil.json; then | |
| echo "changed=false" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "changed=true" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Commit updated data | |
| if: steps.diff.outputs.changed == 'true' | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git add data/Ternopil.json | |
| git commit -m "Update Ternopil outage data" | |
| - name: Push updated data | |
| if: steps.diff.outputs.changed == 'true' | |
| run: git push |