Update files #102
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: Update files | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 8 1 * *' | |
env: | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
jobs: | |
tex-figures: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Get libcurl | |
run: | | |
sudo apt-get update | |
sudo apt-get -y install libcurl4-openssl-dev --fix-missing | |
- name: Setup R | |
uses: r-lib/actions/setup-r@v2 | |
with: | |
r-version: '4.2.0' | |
- name: Install Packages | |
uses: r-lib/actions/setup-renv@v2 | |
- name: Make files | |
run: Rscript -e 'source("build-bib.R", echo = TRUE)' | |
- name: Commit the changes to update_out | |
run: | | |
Rscript -e 'writeLines(as.character(Sys.time()), "out/system_time_r.txt")' | |
date > out/auto_gen_date_bib.txt | |
git config user.name github-actions | |
git config user.email [email protected] | |
git status | |
git add . | |
git status | |
git commit -m "auto-update csv, tex files and figures" | |
git push -d origin update-out | |
git push origin main:update-out | |
- name: Pull Request for Update | |
run: gh pr create -B main -H update-out --title "Bibliography update $(date +'%d. %B %Y')" --body "Created by Github action ${{ github.workflow }}" | |
- name: Comment check results to PR | |
run: gh pr comment update-out --body-file "out/pr_comment.txt" |