Skip to content

Daily Poll

Daily Poll #61

Workflow file for this run

name: Daily Poll
on:
schedule:
- cron: '0 9 * * *' # Executa diariamente às 9h (UTC)
workflow_dispatch: # Permite rodar o workflow manualmente
jobs:
call_api:
runs-on: ubuntu-latest
steps:
- name: Send POST request to create poll
run: |
POLL_DATE=$(date +%d-%m) # Aqui formatamos a data
response=$(curl --request POST \
--url https://whin2.p.rapidapi.com/createpoll \
--header 'Content-Type: application/json' \
--header 'x-rapidapi-host: whin2.p.rapidapi.com' \
--header 'x-rapidapi-key: c23f220f8amsh133ed4cc07f9599p16daf1jsnbfdc7d62024d' \
--data "{\"name\":\"$POLL_DATE\",\"optionNames\":[\"Sim\",\"Não\"],\"selectableOptionCount\":1}")
echo "API Response: $response"