-
Notifications
You must be signed in to change notification settings - Fork 18
43 lines (41 loc) · 1.78 KB
/
check_r.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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@v7
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 }}