From d415b277608626347ce2e1939cf9e479159ea0e5 Mon Sep 17 00:00:00 2001 From: eric sciple Date: Mon, 9 Dec 2019 17:06:03 -0500 Subject: [PATCH] . --- dist/index.js | 7 +++++-- src/github-api-helper.ts | 7 ++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/dist/index.js b/dist/index.js index f6bf49e..765030c 100644 --- a/dist/index.js +++ b/dist/index.js @@ -8093,15 +8093,18 @@ function downloadRepository(accessToken, owner, repo, ref, repositoryPath) { return __awaiter(this, void 0, void 0, function* () { const octokit = new github.GitHub(accessToken); const params = { - archive_format: IS_WINDOWS ? 'zipball' : 'tarball', + archive_format: IS_WINDOWS ? 'zipball' : 'tarballl', owner: owner, repo: repo, ref: ref }; const response = yield octokit.repos.getArchiveLink(params); + if (response.status != 200) { + throw new Error(`GitHub API call failed with response status '${response.status}': ${response.data}`); + } console.log(`status=${response.status}`); console.log(`headers=${JSON.stringify(response.headers)}`); - console.log(`data=${JSON.stringify(typeof (response.data))}`); + console.log(`data=${JSON.stringify(typeof response.data)}`); }); } exports.downloadRepository = downloadRepository; diff --git a/src/github-api-helper.ts b/src/github-api-helper.ts index 3da0154..44fdd73 100644 --- a/src/github-api-helper.ts +++ b/src/github-api-helper.ts @@ -12,12 +12,17 @@ export async function downloadRepository( ): Promise { const octokit = new github.GitHub(accessToken) const params: ReposGetArchiveLinkParams = { - archive_format: IS_WINDOWS ? 'zipball' : 'tarball', + archive_format: IS_WINDOWS ? 'zipball' : 'tarballl', owner: owner, repo: repo, ref: ref } const response = await octokit.repos.getArchiveLink(params) + if (response.status != 200) { + throw new Error( + `GitHub API call failed with response status '${response.status}': ${response.data}` + ) + } console.log(`status=${response.status}`) console.log(`headers=${JSON.stringify(response.headers)}`) console.log(`data=${JSON.stringify(typeof response.data)}`)