Skip to content

Update Jokes

Update Jokes #2

Workflow file for this run

name: Update Jokes
on:
schedule:
- cron: "0 0 */3 * *" # Runs every 3 days at midnight UTC
workflow_dispatch: # Allows manual trigger
jobs:
update-jokes:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Fetch new jokes
run: |
curl -s -H "Accept: application/json" "https://icanhazdadjoke.com/search?limit=100" | jq -r '.results[].joke' > cowsay/jokes.txt
- name: Commit and push changes
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "[email protected]"
git add dotfiles/cowsay/jokes.txt
git commit -m "Auto-update jokes.txt"
git push