From 7f8f3e30a626a3324579ab95fab4730e794417b4 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 27 May 2022 00:09:46 +0200 Subject: [PATCH] Update updater.sh --- .github/workflows/updater.sh | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/.github/workflows/updater.sh b/.github/workflows/updater.sh index 977d7b8..2ed9f2c 100644 --- a/.github/workflows/updater.sh +++ b/.github/workflows/updater.sh @@ -9,9 +9,6 @@ # Since each app is different, maintainers can adapt its contents so as to perform # automatic actions when a new upstream release is detected. -# Remove this exit command when you are ready to run this Action -#exit 1 - #================================================= # FETCHING LATEST RELEASE AND ITS ASSETS #================================================= @@ -36,6 +33,7 @@ fi echo "Current version: $current_version" echo "Latest release from upstream: $version" echo "VERSION=$version" >> $GITHUB_ENV +echo "REPO=$repo" >> $GITHUB_ENV # For the time being, let's assume the script will fail echo "PROCEED=false" >> $GITHUB_ENV @@ -68,43 +66,42 @@ for asset_url in ${assets[@]}; do # Here we base the source file name upon a unique keyword in the assets url (admin vs. update) # Leave $src empty to ignore the asset case $asset_url in - *"vaultwarden"*) + *"vaultwarden"*) src="app" ;; - *"bw_web_builds"*) + *"bw_web_builds"*) src="web" ;; - *) + *) src="" ;; esac # If $src is not empty, let's process the asset if [ ! -z "$src" ]; then - # Create the temporary directory tempdir="$(mktemp -d)" # Download sources and calculate checksum filename=${asset_url##*/} curl --silent -4 -L $asset_url -o "$tempdir/$filename" - checksum=$(sha512sum "$tempdir/$filename" | head -c 64) + checksum=$(sha256sum "$tempdir/$filename" | head -c 64) # Delete temporary directory rm -rf $tempdir # Get extension if [[ $filename == *.tar.gz ]]; then - extension=tar.gz + extension=tar.gz else - extension=${filename##*.} + extension=${filename##*.} fi # Rewrite source file cat < conf/$src.src SOURCE_URL=$asset_url SOURCE_SUM=$checksum -SOURCE_SUM_PRG=sha512sum +SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true SOURCE_FILENAME=