Check versions #103
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Check versions | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '30 4 * * TUE' | |
jobs: | |
check: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@master | |
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 | |
docker rmi $base:latest | |
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 | |
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 }} |