Fix public and private repos
parent
416988e568
commit
5d837c0dbc
|
@ -1,3 +1,4 @@
|
||||||
.idea/
|
.idea/
|
||||||
node_modules/
|
node_modules/
|
||||||
.secrets.rc
|
.secrets.rc
|
||||||
|
.vscode/
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
FROM node:lts-alpine
|
FROM node:lts-alpine
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY package.json package-lock.json ./
|
COPY package.json package-lock.json .
|
||||||
RUN npm ci
|
RUN npm ci
|
||||||
COPY . .
|
COPY docker-entrypoint.sh .
|
||||||
|
COPY src ./src
|
||||||
CMD [ "/app/docker-entrypoint.sh" ]
|
CMD [ "/app/docker-entrypoint.sh" ]
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -8,12 +8,12 @@ async function getGithubRepositories(username, token, mirrorPrivateRepositories)
|
||||||
auth: token || null,
|
auth: token || null,
|
||||||
});
|
});
|
||||||
|
|
||||||
const publicRepositoriesWithForks = await octokit.paginate('GET /users/:username/repos', { username: username })
|
const publicRepositoriesWithForks = await octokit.paginate('GET /user/repos?visibility=public&affiliation=owner&visibility=public', { username: username })
|
||||||
.then(repositories => toRepositoryList(repositories));
|
.then(repositories => toRepositoryList(repositories));
|
||||||
|
|
||||||
let allRepositoriesWithoutForks;
|
let allRepositoriesWithoutForks;
|
||||||
if(mirrorPrivateRepositories === 'true'){
|
if(mirrorPrivateRepositories === 'true'){
|
||||||
allRepositoriesWithoutForks = await octokit.paginate('GET /search/repositories?q=user:{username}', { username : username })
|
allRepositoriesWithoutForks = await octokit.paginate('GET /user/repos?visibility=public&affiliation=owner&visibility=private', { username : username })
|
||||||
.then(repositories => toRepositoryList(repositories));
|
.then(repositories => toRepositoryList(repositories));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,7 +104,7 @@ async function main() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const giteaToken = process.env.GITEA_TOKE;
|
const giteaToken = process.env.GITEA_TOKEN;
|
||||||
if (!giteaToken) {
|
if (!giteaToken) {
|
||||||
console.error('No GITEA_TOKEN specified, please specify! Exiting..');
|
console.error('No GITEA_TOKEN specified, please specify! Exiting..');
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue