From c1d31e18ab84f9ae78fd0bbc83a74c53fc557c45 Mon Sep 17 00:00:00 2001 From: benniekiss Date: Fri, 5 Jul 2024 19:09:25 +0000 Subject: [PATCH] exit without output on failed download in the case the provided access token doesn't have the appropriate permissions, exit without output. Otherwise, the downloaded files will not have the expected contents. --- forgejo-release.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/forgejo-release.sh b/forgejo-release.sh index 1df8d2b..e113b4c 100755 --- a/forgejo-release.sh +++ b/forgejo-release.sh @@ -149,7 +149,7 @@ download() { cd $RELEASE_DIR api GET repos/$REPO/releases/tags/$TAG > $TMP_DIR/assets.json jq --raw-output '.assets[] | "\(.name) \(.browser_download_url)"' < $TMP_DIR/assets.json | while read name url ; do - curl -H "Authorization: token $TOKEN" -o $name -L $url + curl --fail -H "Authorization: token $TOKEN" -o $name -L $url done ) }