Skip to content

rtip

rtip #320

Workflow file for this run

on:
schedule:
- cron: '0 10 * * 1-5' # Lunes a viernes 10:00 UTC (7:00 Argentina)
workflow_dispatch: # Permite ejecutar manualmente desde GitHub
name: rtip
permissions:
contents: write
jobs:
run-r-script:
runs-on: ubuntu-latest
env:
TELEGRAM_TOKEN_BOT: ${{ secrets.TELEGRAM_TOKEN_BOT }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
steps:
- uses: actions/checkout@v6
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
- uses: r-lib/actions/setup-r-dependencies@v2
with:
packages: |
any::googlesheets4
any::dplyr
any::stringr
any::telegram.bot
any::glue
any::readr
any::magrittr
any::here
any::curl
- name: Crea y postea tip
run: "Rscript R/script_bot.R"
- name: Commit results
run: |
git config --local user.email "actions@github.com"
git config --local user.name "GitHub Actions"
git add data/r_tips_historial.rds data/rtips-tuits.log data/r_tips_bot_usuarios.rds
git diff --staged --quiet && echo "Sin cambios" || (git commit -m "posteo r tip" && git push origin)