-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (32 loc) · 1.14 KB
/
alarmfase1els.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: alarmfase1els
on:
schedule:
- cron: "0/10 * * * *"
workflow_dispatch:
jobs:
run:
runs-on: ubuntu-latest
steps:
- name: Install required PowerShell modules
shell: pwsh
run: |
Set-PSRepository PSGallery -InstallationPolicy Trusted
Install-Module Uncommonsense.Hap, UncommonSense.P2000, UncommonSense.Pushover -Scope CurrentUser
- name: Send notifications
shell: pwsh
env:
PUSHOVER_APP_ALARMFASE1: ${{secrets.PUSHOVER_APP_ALARMFASE1}}
PUSHOVER_USER_ELS: ${{secrets.PUSHOVER_USER_ELS}}
run: |
Get-P2000Entry -Region utrecht -City veenendaal
| Where-Object Priority -In 'P1', 'A1' `
| Where-Object DateTimeUtc -GT (Get-Date -AsUtc).AddMinutes(-10) `
| Select-Object -First 10
| ForEach-Object {
Send-PushoverNotification `
-ApplicationToken $env:PUSHOVER_APP_ALARMFASE1 `
-Recipient $env:PUSHOVER_USER_ELS `
-Title $_.Title `
-Message $_.Original `
-SupplementaryUrl $_.Link
}