fix: isolate import-batch token failures
This commit is contained in:
parent
721ba343cc
commit
1bb4bd608c
1 changed files with 23 additions and 23 deletions
46
src/cli.js
46
src/cli.js
|
|
@ -655,30 +655,30 @@ repo
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
const service = item.service || 'github';
|
|
||||||
const isPrivate = item.public ? false : Boolean(item.private);
|
|
||||||
const payload = {
|
|
||||||
clone_addr: from,
|
|
||||||
repo_name: name,
|
|
||||||
repo_owner: item.owner || item.repo_owner || config.login,
|
|
||||||
service,
|
|
||||||
description: item.description || undefined,
|
|
||||||
private: isPrivate,
|
|
||||||
issues: normalizeBool(item.issues, true),
|
|
||||||
labels: normalizeBool(item.labels, true),
|
|
||||||
milestones: normalizeBool(item.milestones, true),
|
|
||||||
pull_requests: normalizeBool(item.pull_requests, true),
|
|
||||||
releases: normalizeBool(item.releases, true),
|
|
||||||
wiki: normalizeBool(item.wiki, true),
|
|
||||||
lfs: normalizeBool(item.lfs, false),
|
|
||||||
auth_token: resolveSourceToken(item.github_token, service),
|
|
||||||
};
|
|
||||||
|
|
||||||
Object.keys(payload).forEach((key) => {
|
|
||||||
if (payload[key] === undefined) delete payload[key];
|
|
||||||
});
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
const service = item.service || 'github';
|
||||||
|
const isPrivate = item.public ? false : Boolean(item.private);
|
||||||
|
const payload = {
|
||||||
|
clone_addr: from,
|
||||||
|
repo_name: name,
|
||||||
|
repo_owner: item.owner || item.repo_owner || config.login,
|
||||||
|
service,
|
||||||
|
description: item.description || undefined,
|
||||||
|
private: isPrivate,
|
||||||
|
issues: normalizeBool(item.issues, true),
|
||||||
|
labels: normalizeBool(item.labels, true),
|
||||||
|
milestones: normalizeBool(item.milestones, true),
|
||||||
|
pull_requests: normalizeBool(item.pull_requests, true),
|
||||||
|
releases: normalizeBool(item.releases, true),
|
||||||
|
wiki: normalizeBool(item.wiki, true),
|
||||||
|
lfs: normalizeBool(item.lfs, false),
|
||||||
|
auth_token: resolveSourceToken(item.github_token, service),
|
||||||
|
};
|
||||||
|
|
||||||
|
Object.keys(payload).forEach((key) => {
|
||||||
|
if (payload[key] === undefined) delete payload[key];
|
||||||
|
});
|
||||||
|
|
||||||
const result = await client.migrateRepo(payload);
|
const result = await client.migrateRepo(payload);
|
||||||
console.log(`Imported: ${result.full_name} -> ${result.html_url}`);
|
console.log(`Imported: ${result.full_name} -> ${result.html_url}`);
|
||||||
results.push({ name, status: 'ok', url: result.html_url });
|
results.push({ name, status: 'ok', url: result.html_url });
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue