Skip to content

Commit a371079

Browse files
committed
2 parents 2757f40 + 697a852 commit a371079

File tree

6 files changed

+90
-6
lines changed

6 files changed

+90
-6
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,21 @@ jobs:
2929
with:
3030
repository: davemattson/pse-outage
3131
path: pse-outage
32-
fetch-depth: 10
32+
fetch-depth: 20
3333

3434
- name: Checkout the scl repository
3535
uses: actions/checkout@v4
3636
with:
3737
repository: davemattson/scl-outage
3838
path: scl-outage
39-
fetch-depth: 10
39+
fetch-depth: 20
4040

4141
- name: Checkout the snopud repository
4242
uses: actions/checkout@v4
4343
with:
4444
repository: davemattson/snopud-outage
4545
path: snopud-outage
46-
fetch-depth: 10
46+
fetch-depth: 20
4747

4848
- name: Set up Python
4949
uses: actions/setup-python@v5
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: Send notifications for outages
2+
3+
on:
4+
push:
5+
workflow_dispatch:
6+
schedule:
7+
- cron: '*/6 * * * *'
8+
9+
env:
10+
PWRONDATABOT_TOKEN: ${{ secrets.PWRONDATABOT_TOKEN }}
11+
GEOCODE_API_KEY: ${{ secrets.GEOCODE_API_KEY }}
12+
13+
jobs:
14+
outage_watcher:
15+
runs-on: ubuntu-latest
16+
defaults:
17+
run:
18+
shell: bash
19+
working-directory: outage-data-analysis
20+
21+
steps:
22+
- name: Checkout current repository
23+
uses: actions/checkout@v4
24+
with:
25+
path: outage-data-analysis
26+
27+
- name: Checkout the pse repository
28+
uses: actions/checkout@v4
29+
with:
30+
repository: davemattson/pse-outage
31+
path: pse-outage
32+
fetch-depth: 20
33+
34+
- name: Checkout the scl repository
35+
uses: actions/checkout@v4
36+
with:
37+
repository: davemattson/scl-outage
38+
path: scl-outage
39+
fetch-depth: 20
40+
41+
- name: Checkout the snopud repository
42+
uses: actions/checkout@v4
43+
with:
44+
repository: davemattson/snopud-outage
45+
path: snopud-outage
46+
fetch-depth: 20
47+
48+
- name: Set up Python
49+
uses: actions/setup-python@v5
50+
with:
51+
python-version: '3.x' # Use the latest Python 3 version
52+
53+
- name: Install dependencies
54+
run: |
55+
python -m pip install --upgrade pip
56+
pip install pykml
57+
pip install pandas
58+
pip install pytz
59+
pip install requests
60+
pip install gitpython
61+
62+
- uses: qoomon/actions--setup-git@v1
63+
with:
64+
user: bot
65+
66+
- name: Run pse expand
67+
continue-on-error: true
68+
run: |
69+
git pull origin main
70+
python -u expand.py -r ../pse-outage -i last_file_pse_test.txt -o output_files -l 10 ../pse-outage/pse-events.json
71+
72+
- name: Save pse progress if succeeded
73+
continue-on-error: true
74+
if: success()
75+
run: |
76+
git add last_file_pse_test.txt
77+
git commit -m "updating file to track latest processed commit for PSE"
78+
git push -u origin main
79+
80+
- name: Run pse notify
81+
continue-on-error: true
82+
run: |
83+
python -d output_files -r .5 -c 1 -e .1 -u pse --telegram-token "${PWRONDATABOT_TOKEN}" --telegram-chat-id "-1003012377346" --telegram-thread-id "2" --geocode-api-key "${GEOCODE_API_KEY}"

last_file_pse.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2025-08-29T230013-pse-events.json
1+
2025-09-04T055227-pse-events.json

last_file_pse_test.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2025-09-04T055227-pse-events.json

last_file_scl.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2025-08-29T225112-scl-events.json
1+
2025-09-04T043115-scl-events.json

last_file_snopud.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2025-08-29T230941-KMLOutageAreas.xml
1+
2025-09-04T055450-KMLOutageAreas.xml

0 commit comments

Comments
 (0)