check-aid4mail-hash #162
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
# 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 |