build: update hasher return value (#47012)

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
This commit is contained in:
trop[bot] 2025-05-09 12:53:11 -04:00 committed by GitHub
commit f5bb2f480d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -28,7 +28,9 @@ export async function getUrlHash (targetUrl: string, algorithm = 'sha256', attem
}
if (!resp.body) throw new Error('Successful lambda call but failed to get valid hash');
return resp.body.trim();
// response shape should be { hash: 'xyz', invocationId: "abc"}
const { hash } = JSON.parse(resp.body.trim());
return hash;
} catch (err) {
if (attempts > 1) {
const { response } = err as any;