Send notifications for new/resolved outages #32
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: Scrape latest outage data | |
on: | |
push: | |
workflow_dispatch: | |
schedule: | |
- cron: '*/5 * * * *' | |
env: | |
PWRONDATABOT_TOKEN: ${{ secrets.PWRONDATABOT_TOKEN }} | |
GEOCODE_API_KEY: ${{ secrets.GEOCODE_API_KEY }} | |
jobs: | |
scheduled: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash | |
working-directory: outage-data-analysis | |
steps: | |
- name: Checkout current repository | |
uses: actions/checkout@v4 | |
with: | |
path: outage-data-analysis | |
- name: Checkout the pse repository | |
uses: actions/checkout@v4 | |
with: | |
repository: davemattson/pse-outage | |
path: pse-outage | |
- name: Checkout the scl repository | |
uses: actions/checkout@v4 | |
with: | |
repository: davemattson/scl-outage | |
path: scl-outage | |
- name: Checkout the snopud repository | |
uses: actions/checkout@v4 | |
with: | |
repository: davemattson/snopud-outage | |
path: snopud-outage | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' # Use the latest Python 3 version | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pykml | |
pip install pandas | |
pip install pytz | |
pip install requests | |
pip install gitpython | |
- name: Print Working Directory | |
run: pwd | |
- name: Run pse notifier | |
run: | | |
echo "Running PSE notifier" | |
git config user.name "outage-data" | |
git config user.email "actions@users.noreply.github.com" | |
git diff-tree fc9f1ed20b57e35808953c59830f19765f959983 26a5d3347b02654dbd65f23f256f6124aaf45a82 -r --abbrev=40 --full-index -M --raw -z --no-color |