Skip to content

Daily check

Daily check #8

Workflow file for this run

name: Daily check
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *' # Runs once a day at midnight UTC
jobs:
compare_variables:
runs-on: ubuntu-latest
steps:
- name: Compare variables
id: compare
run: |
latest_hash=$(curl -s https://registry.hub.docker.com/v2/repositories/bobbintb/unraid-bzroot/tags/latest | jq -r .images[0].digest)
docker_current_version=$(curl -s https://registry.hub.docker.com/v2/repositories/bobbintb/unraid-bzroot/tags/ | jq -r '.results[] | select(.name != "latest") | select(.images[0].digest == "'"$latest_hash"'") | .name')
json=$(curl -s https://releases.unraid.net/usb-creator)
unraind_latest_version="${1:-$(echo "$json" | jq -r '.os_list[0].name' | sed 's/Unraid //')}"
echo "Latest version of Unraid is ${unraind_latest_version} and latest Docker image is ${docker_current_version}"
if [ "$docker_current_version" == "$unraind_latest_version" ]; then
echo "No new version. Nothing to do."
echo "trigger_another_action=true" >> $GITHUB_ENV
else
echo "No new version. Nothing to do."
fi
- name: Run another action if variables don't match
if: env.trigger_another_action == 'true'
uses: kumarabd/[email protected]
with:
name: "bzroot"
token: ${{ secrets.GITHUB_TOKEN }}