Skip to content

alarmfase1els

alarmfase1els #50530

Workflow file for this run

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
}