1
0
Fork 0
mirror of https://code.forgejo.org/actions/checkout.git synced 2024-11-26 19:34:50 +01:00
This commit is contained in:
eric sciple 2019-12-09 17:06:03 -05:00
parent 4af80cb867
commit d415b27760
2 changed files with 11 additions and 3 deletions

7
dist/index.js vendored
View file

@ -8093,15 +8093,18 @@ function downloadRepository(accessToken, owner, repo, ref, repositoryPath) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
const octokit = new github.GitHub(accessToken); const octokit = new github.GitHub(accessToken);
const params = { const params = {
archive_format: IS_WINDOWS ? 'zipball' : 'tarball', archive_format: IS_WINDOWS ? 'zipball' : 'tarballl',
owner: owner, owner: owner,
repo: repo, repo: repo,
ref: ref ref: ref
}; };
const response = yield octokit.repos.getArchiveLink(params); 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(`status=${response.status}`);
console.log(`headers=${JSON.stringify(response.headers)}`); 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; exports.downloadRepository = downloadRepository;

View file

@ -12,12 +12,17 @@ export async function downloadRepository(
): Promise<void> { ): Promise<void> {
const octokit = new github.GitHub(accessToken) const octokit = new github.GitHub(accessToken)
const params: ReposGetArchiveLinkParams = { const params: ReposGetArchiveLinkParams = {
archive_format: IS_WINDOWS ? 'zipball' : 'tarball', archive_format: IS_WINDOWS ? 'zipball' : 'tarballl',
owner: owner, owner: owner,
repo: repo, repo: repo,
ref: ref ref: ref
} }
const response = await octokit.repos.getArchiveLink(params) 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(`status=${response.status}`)
console.log(`headers=${JSON.stringify(response.headers)}`) console.log(`headers=${JSON.stringify(response.headers)}`)
console.log(`data=${JSON.stringify(typeof response.data)}`) console.log(`data=${JSON.stringify(typeof response.data)}`)