Check R Version #193
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: Check R Version | |
on: | |
schedule: | |
- cron: '0 4 * * 6' | |
jobs: | |
updateR: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install libs | |
run: sudo apt-get update && sudo apt-get install curl jq -y | |
- name: Get Latest R Release | |
id: r-version | |
run: | | |
echo "release_tag=$(curl 'https://cran.rstudio.com/src/base/R-4/' | grep -oP 'href="R-\K[0-9]+\.[0-9]+\.[0-9]+' | sort -t. -rn -k1,1 -k2,2 -k3,3 | head -1)" >> $GITHUB_OUTPUT | |
echo "current_tag=$(<R-version.txt)" >> $GITHUB_OUTPUT | |
- name: Update R-version.txt | |
if: steps.r-version.outputs.current_tag != steps.r-version.outputs.release_tag | |
env: | |
RELEASE_TAG: ${{ steps.r-version.outputs.release_tag }} | |
run: | | |
# Update current release | |
echo ${{ steps.r-version.outputs.release_tag }} > R-version.txt | |
- name: Update Readme.md & Dockerfile | |
uses: jacobtomlinson/gha-find-replace@master | |
with: | |
find: ${{ steps.r-version.outputs.current_tag }} | |
replace: ${{ steps.r-version.outputs.release_tag }} | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v6 | |
with: | |
commit-message: Update R to ${{ steps.r-version.outputs.release_tag }} | |
title: Update R to ${{ steps.r-version.outputs.release_tag }} | |
body: | | |
Updates [r-version][1] to ${{ steps.r-version.outputs.release_tag }} | |
Auto-generated by [create-pull-request][2] | |
[1]: https://cran.rstudio.com/src/base/R-4/ | |
[2]: https://github.com/peter-evans/create-pull-request | |
labels: dependencies, automated pr | |
branch: R-updates | |
token: ${{ secrets.REPO_SCOPED_TOKEN }} |