Fix public and private repos
parent
416988e568
commit
5d837c0dbc
|
@ -1,3 +1,4 @@
|
|||
.idea/
|
||||
node_modules/
|
||||
.secrets.rc
|
||||
.vscode/
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
FROM node:lts-alpine
|
||||
|
||||
WORKDIR /app
|
||||
COPY package.json package-lock.json ./
|
||||
COPY package.json package-lock.json .
|
||||
RUN npm ci
|
||||
COPY . .
|
||||
COPY docker-entrypoint.sh .
|
||||
COPY src ./src
|
||||
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,
|
||||
});
|
||||
|
||||
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));
|
||||
|
||||
let allRepositoriesWithoutForks;
|
||||
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));
|
||||
}
|
||||
|
||||
|
@ -104,7 +104,7 @@ async function main() {
|
|||
return;
|
||||
}
|
||||
|
||||
const giteaToken = process.env.GITEA_TOKE;
|
||||
const giteaToken = process.env.GITEA_TOKEN;
|
||||
if (!giteaToken) {
|
||||
console.error('No GITEA_TOKEN specified, please specify! Exiting..');
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue