-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (36 loc) · 1.01 KB
/
update.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
on:
push:
paths:
- .github/workflows/update.yml
- update.R
schedule:
## Run twice an hour
- cron: '5,35 * * * *'
name: "CRAN synchronization"
jobs:
update:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Configure Git
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
- uses: r-lib/actions/setup-r@v2
- name: Install R dependencies
run: install.packages("jsonlite")
shell: Rscript {0}
- name: Refresh packages.json
run: |
git fetch --all
git pull
Rscript update.R
mapfile -t pkgs < <(grep -F package packages.json)
echo "Number of CRANhaven packages: ${#pkgs[@]}"
- name: Commit and Push Changes
run: |
git add packages.json
git commit -m "Synchronized with CRAN" || echo "No changes to commit"
git push