-
Notifications
You must be signed in to change notification settings - Fork 81
66 lines (59 loc) · 1.95 KB
/
check_r_dependencies.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Check R dependencies
on:
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '0 0 * * 0'
workflow_run:
workflows:
- 'Run Tests'
types:
- completed
branches:
- 'main'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: write
pull-requests: write
jobs:
check-r-dependencies:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Check for available updates
run: |
for REQUIREMENTS in $(ls -1 docker/*/r_requirements.txt); do
IMAGE=$(echo ${REQUIREMENTS} | sed 's:^docker/::' | sed 's:/.*::')
docker pull -q singlecellopenproblems/${IMAGE}
PKG_CHANGED=$(
docker run -t --rm --user=root \
-v $(pwd):/usr/src/singlecellopenproblems \
singlecellopenproblems/${IMAGE} \
Rscript /usr/src/singlecellopenproblems/scripts/upgrade_renv.R \
/usr/src/singlecellopenproblems/${REQUIREMENTS} | \
tee /dev/stderr | \
tail -n 1 | \
sed 's-::-/-g'
)
git diff --exit-code || break
PKG_CHANGED=""
done
echo "PKG_CHANGED=$(echo ${PKG_CHANGED} | sed 's/@/ to /')" >> $GITHUB_ENV
echo "UPDATE_BRANCH_NAME=dependencies/r/${PKG_CHANGED}" >> $GITHUB_ENV
- name: Create Pull Request
if: >-
env.PKG_CHANGED != ''
uses: peter-evans/create-pull-request@v4
with:
branch: ${{ env.UPDATE_BRANCH_NAME }}
delete-branch: true
base: main
labels: dependencies,r
title: "Update ${{ env.PKG_CHANGED }}"
committer: "openproblems-bio <[email protected]>"
author: "openproblems-bio <[email protected]>"
commit-message: "Update ${{ env.PKG_CHANGED }} # ci skip"
draft: true