Skip to content

check-aid4mail-hash #162

check-aid4mail-hash

check-aid4mail-hash #162

Workflow file for this run

# This workflow should download the latest Aid4Mail zip, and compare the previous hash
# with the current hash.
name: check-aid4mail-hash
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
jobs:
aid4mail_hash:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- name: Check Aid4Mail Hash
run: |
wget https://www.aid4mail.com/download/Aid4Mail5_Setup.zip
PREVIOUS_HASH=$(cat /home/runner/work/winfor-salt/winfor-salt/winfor/installers/aid4mail.sls | grep "set hash" | awk -F\' '{print tolower($2)}')
CURRENT_HASH=$(sha256sum Aid4Mail5_Setup.zip | awk '{print $1}')
if [[ "$PREVIOUS_HASH" != "$CURRENT_HASH" ]]; then echo "HASH UPDATED - $CURRENT_HASH" && exit 1; else echo "No hash changes" && exit 0; fi