-
Notifications
You must be signed in to change notification settings - Fork 7
50 lines (43 loc) · 1.66 KB
/
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
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: "
staphb_containers=($(grep -h container donut_falls.nf | grep staphb | sort | uniq | grep -v latest | awk '{print $2}' | sed 's/'\''//g'))
for container in ${staphb_containers[@]}
do
echo "Looking at $container"
base=$(echo $container | cut -f 1 -d ":")
repo_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" == "$repo_version" ]]
then
echo "No version change for $base:$repo_version" | tee -a versions.txt
else
echo "New version for $base! Upgrade to $latest_version from $repo_version." | tee -a versions.txt
issue_text="$issue_text $base from $repo_version to $latest_version "
fi
docker rmi $base:latest
done
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 }}