From a7a5866672c102c91ac31983349db193c616135a Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Tue, 14 Apr 2020 07:41:42 +0200 Subject: [PATCH] Try pyhton for sha256 --- .../workflows/update-chocolatey-jabref-nightly.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/update-chocolatey-jabref-nightly.yml b/.github/workflows/update-chocolatey-jabref-nightly.yml index a7945eaf631a..735b70fb8f7a 100644 --- a/.github/workflows/update-chocolatey-jabref-nightly.yml +++ b/.github/workflows/update-chocolatey-jabref-nightly.yml @@ -42,10 +42,17 @@ jobs: steps: - name: Determine sha256 sums id: checksum - shell: bash + shell: python run: | - wget https://builds.jabref.org/master/JabRef-5.1.msi -o /tmp/jabref.msi - echo ::set-output checksum::`sha256sum < /tmp/jabref.msi | sed s/ .*//` + from urllib.request import urlretrieve + import hashlib + + tmpfile, headers = urlretrieve('https://builds.jabref.org/master/JabRef-5.1.msi') + hash = hashlib.sha256() + with open(tmpfile, "rb") as f: + for chcunk in iter(lambda: f.read(4096), b"") + hash.update(chunk) + print(f'::set-output name=secretspresent::{hash.hexdigest()}') - name: Checkout source uses: actions/checkout@v2 - name: Fetch all history for all tags and branches