Fetch latest BC Hydro outage data #149806
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: Fetch latest BC Hydro outage data | |
| on: | |
| push: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "1,16,31,46 * * * *" | |
| jobs: | |
| scheduled: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Fetches repo | |
| uses: actions/checkout@v3 | |
| - name: Get and format api | |
| run: |- | |
| curl https://www.bchydro.com/power-outages/app/outages-map-data.json | jq . > bchydro-outages.json | |
| - name: Add results to config | |
| run: |- | |
| git config user.name "Automated" | |
| git config user.email "actions@users.noreply.github.com" | |
| git add -A *.json | |
| timestamp=$(date -u -Is) | |
| git commit -m "Update data on ${timestamp}" || exit 0 | |
| git push |