Skip to content

autobuild

autobuild #120

Workflow file for this run

---
name: Check Shasums
on: [pull_request]
jobs:
shasum:
name: Check images are ok
runs-on: ubuntu-latest
steps:
# Checks out a copy of your repository on the ubuntu-latest machine
- name: Checkout code
uses: actions/checkout@v4
with:
# Make sure the actual branch is checked out when running on PR
ref: ${{ github.event.pull_request.head.sha }}
# Full git history needed to get proper list of changed files
fetch-depth: 0
# Installs yq
- name: Install yq
run: |
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys CC86BB64
sudo add-apt-repository -y ppa:rmescandon/yq
sudo apt update
sudo apt install -y -q yq
# Runs the Super-Linter action
- name: Calculate the sum for new images
run: |
for f in $(git diff --name-only ${{ github.event.pull_request.base.sha }} | grep "appdb.*\.yaml")
do
[ -e "$f" ] || continue
echo "Testing $f"
url=$(yq eval .appdb.url "$f")
curl -I "$url" || exit 1
# now download and shasum
sha_url=$(curl -s "$url" | sha512sum | cut -f1 -d"-" | tr -d "[:space:]")
sha_appdb=$(yq eval .appdb.sha512 "$f")
if [ "$sha_url" != "$sha_appdb" ]
then
echo "SHA SUM does not match $sha_url $sha_appdb!"
# don't try to download anything else
exit 1
fi
done