Skip to content

dadjoke

dadjoke #141

Workflow file for this run

name: dadjoke
on:
schedule:
- cron: "41 5 * * *"
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.Pushover -Scope CurrentUser
- name: Send notification
shell: pwsh
env:
PUSHOVER_APP_DADJOKE: ${{secrets.PUSHOVER_APP_DADJOKE}}
PUSHOVER_USER_DADJOKE: ${{secrets.PUSHOVER_USER_DADJOKE}}
run: |
Invoke-RestMethod https://icanhazdadjoke.com -Headers @{'Accept'= 'application/json'}
| ForEach-Object {
Send-PushoverNotification `
-ApplicationToken $env:PUSHOVER_APP_DADJOKE `
-Recipient $env:PUSHOVER_USER_DADJOKE `
-Message $_.Joke `
-Title 'Dad Joke'
}