3
0
Fork 0
mirror of https://github.com/actions/checkout.git synced 2024-11-26 04:49:30 +01:00
This commit is contained in:
eric sciple 2019-12-10 01:52:10 -05:00
parent 19fb09ae8f
commit 4a1fa615de
2 changed files with 4 additions and 0 deletions

2
dist/index.js vendored
View file

@ -8391,9 +8391,11 @@ function downloadRepository(accessToken, owner, repo, ref, commit, repositoryPat
ref: refHelper.getDownloadRef(ref, commit)
};
const response = yield octokit.repos.getArchiveLink(params);
console.log('GOT THE RESPONSE');
if (response.status != 302) {
throw new Error(`Unexpected response from GitHub API. Status: '${response.status}'`);
}
console.log('GETTING THE LOCATION');
const archiveUrl = response.headers['Location']; // Do not print the archive URL because it has an embedded token
assert.ok(archiveUrl, `Expected GitHub API response to contain 'Location' header`);
// Download the archive

View file

@ -51,11 +51,13 @@ export async function downloadRepository(
ref: refHelper.getDownloadRef(ref, commit)
}
const response = await octokit.repos.getArchiveLink(params)
console.log('GOT THE RESPONSE')
if (response.status != 302) {
throw new Error(
`Unexpected response from GitHub API. Status: '${response.status}'`
)
}
console.log('GETTING THE LOCATION')
const archiveUrl = response.headers['Location'] // Do not print the archive URL because it has an embedded token
assert.ok(
archiveUrl,