check-bulk-reviewer-hash #362
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 BulkReviewer, | |
# and compare the previous hash with the current hash. | |
name: check-bulk-reviewer-hash | |
on: | |
schedule: | |
- cron: "0 0 * * *" | |
workflow_dispatch: | |
jobs: | |
bulk_reviewer_hash: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@main | |
- name: Check Bulk-Reviewer Hash | |
run: | | |
VERSION=$(cat /home/runner/work/bitcurator-salt/bitcurator-salt/bitcurator/packages/bulk-reviewer.sls | grep "set version" | awk -F\" '{print $2}') | |
wget https://github.com/bulk-reviewer/bulk-reviewer/releases/download/v$VERSION/BulkReviewer-$VERSION.AppImage | |
PREVIOUS_HASH=$(cat /home/runner/work/bitcurator-salt/bitcurator-salt/bitcurator/packages/bulk-reviewer.sls | grep "set hash" | awk -F\' '{print $2}') | |
CURRENT_HASH=$(sha256sum BulkReviewer-$VERSION.AppImage | awk '{print $1}') | |
if [[ "$PREVIOUS_HASH" != "$CURRENT_HASH" ]]; then echo "HASH HAS CHANGED - NEW HASH: $CURRENT_HASH" && exit 1; else echo "No hash changes" && exit 0; fi |