Daily check #25
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: Daily check | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 0 * * *' # Runs once a day at midnight UTC | |
jobs: | |
compare_variables: | |
runs-on: ubuntu-latest | |
permissions: | |
actions: write | |
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: Trigger Github workflow | |
if: env.trigger_another_action == 'true' | |
uses: yakubique/trigger-github-workflow@v1 | |
with: | |
repository: bobbintb/unraid-docker | |
workflow: bzroot.yml | |
# token: ${{ secrets.GITHUB_TOKEN }} |