Skip to content

brugopen

brugopen #11140

Workflow file for this run

name: brugopen
on:
schedule:
- cron: "0/5 7-22 * * *"
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.BridgeOpenings, UncommonSense.Pushover -Scope CurrentUser
- name: Send notifications
shell: pwsh
env:
PUSHOVER_APP_BRUGOPEN: ${{secrets.PUSHOVER_APP_BRUGOPEN}}
PUSHOVER_USER_JUSTME: ${{secrets.PUSHOVER_USER_JUSTME}}
run: |
Get-CurrentlyOpenBridge
| Where-Object BridgeId -eq 'bosrandbrug'
| ForEach-Object {
Send-PushoverNotification `
-ApplicationToken $env:PUSHOVER_APP_BRUGOPEN `
-Recipient $env:PUSHOVER_USER_JUSTME `
-Title "$($_.BridgeName) is open" `
-Message "Since $($_.Since) for a duration of $($_.Duration)"
}