Weblate User Statistics Refresh #496
This file contains hidden or 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: Weblate User Statistics Refresh | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "30 12 * * *" | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - "weblate/User Statistics/**" | |
| - ".github/workflows/weblate_user_statistics.yml" | |
| jobs: | |
| Running_R_scripts: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: weblate/User Statistics | |
| steps: | |
| - name: checkout_repo | |
| uses: actions/checkout@v4 | |
| - uses: r-lib/actions/setup-r@v2 | |
| - name: Install packages | |
| uses: r-lib/actions/setup-r-dependencies@v2 | |
| with: | |
| packages: | | |
| any::jsonlite | |
| any::rvest | |
| any::readr | |
| any::dplyr | |
| any::curl | |
| any::lubridate | |
| - name: Run R scripts | |
| env: | |
| WEBLATE_TOKEN: ${{ secrets.WEBLATE_TOKEN }} | |
| run: | | |
| Rscript "User_statistics.R" | |
| - name: Commit and Push Any Changes | |
| run: | | |
| git pull | |
| git add *.csv | |
| if ! git diff-index --quiet HEAD; then | |
| git config --local user.email "action@github.com" | |
| git config --local user.name "GitHub Action" | |
| git commit -m "Update weblate users csv" | |
| git push | |
| fi |