Daily Poll #61
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |