Skip to content

Commit

Permalink
Merge pull request #969 from quarto-dev/dragonstyle-patch-1
Browse files Browse the repository at this point in the history
Check fetch response when gathering assets.
  • Loading branch information
dragonstyle authored Jan 9, 2024
2 parents accdc02 + 6988b7c commit 3164c9b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/actions/release-info/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,11 @@ async function run() {
const redirects = [];
for (asset of releaseRaw.assets) {
const algorithm = "sha256";
const assetFile = await fetch(asset.browser_download_url);
const buffer = await assetFile.buffer();
const response = await fetch(asset.browser_download_url);
if (!response.ok) {
throw new Error(`Failed to fetch asset. The http request for the asset at ${asset.browser_download_url} return the status ${response.status}`);
}
const buffer = await response.buffer();
const checksum = hasha(buffer, { algorithm });

if (asset.name === 'changelog.md') {
Expand Down

0 comments on commit 3164c9b

Please sign in to comment.