-
Notifications
You must be signed in to change notification settings - Fork 27
71 lines (59 loc) · 3.08 KB
/
check_versions.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
67
68
69
70
71
name: Check versions
on:
workflow_dispatch:
schedule:
- cron: '30 4 * * TUE'
jobs:
check:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
lfs: true
- name: Checkout LFS objects
run: git lfs checkout
- name: versions
run: |
issue_text="Needing updates: "
workflow_containers=($(grep container modules/* | grep staphb | sort | uniq | grep -v latest | awk '{print $3}' | sed 's/'\''//g'))
for container in ${workflow_containers[@]}
do
base=$(echo $container | cut -f 1 -d ":")
workflow_version=$(echo $container | cut -f 2 -d ":")
docker pull $base:latest
latest_version=$(docker inspect --format '{{ index .Config.Labels "software.version"}}' $base:latest)
if [[ "$latest_version" == "$workflow_version" ]]
then
echo "No version change for $base:$workflow_version" | tee -a versions.txt
else
echo "New version for $base! Upgrade to $latest_version from $workflow_version." | tee -a versions.txt
issue_text="$issue_text<br>- $base from $workflow_version to $latest_version "
fi
done
latest_nextclade_version=$(docker run nextstrain/nextclade:latest nextclade --version | awk '{print $2}')
worfklow_nextclade_version=$(grep container modules/nextclade.nf | cut -f 2 -d ":" | cut -f 1 -d "'" | head -n 1)
if [[ "$latest_nextclade_version" == "$worfklow_nextclade_version" ]]
then
echo "No version change for nextstrain/nextclade:$worfklow_nextclade_version" | tee -a versions.txt
else
echo "New version for nextstrain/nextclade! Upgrade to $latest_nextclade_version from $worfklow_nextclade_version." | tee -a versions.txt
issue_text="$issue_text<br>- nextstrain/nextclade from $worfklow_nextclade_version to $latest_nextclade_version "
fi
latest_nextalign_version=$(docker run nextstrain/nextalign:latest nextalign --version | awk '{print $2}')
worfklow_nextalign_version=$(grep container modules/nextalign.nf | cut -f 2 -d ":" | cut -f 1 -d "'" | head -n 1)
if [[ "$latest_nextalign_version" == "$worfklow_nextalign_version" ]]
then
echo "No version change for nextstrain/nextalign:$worfklow_nextalign_version" | tee -a versions.txt
else
echo "New version for nextstrain/nextalign! Upgrade to $latest_nextalign_version from $worfklow_nextalign_version." | tee -a versions.txt
issue_text="$issue_text<br>- nextstrain/nextalign from $worfklow_nextalign_version to $latest_nextalign_version "
fi
echo $issue_text
cat versions.txt
echo 'ISSUE_TEXT='$issue_text >> $GITHUB_ENV
- name: Create Issue
run: |
gh issue create --title "Version check" --body "$ISSUE_TEXT" --repo $GITHUB_REPOSITORY
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}