Skip to content

Commit

Permalink
Cloudquery github resolver should handle null github fields (#1431)
Browse files Browse the repository at this point in the history
  • Loading branch information
ravenac95 authored May 16, 2024
1 parent 80d3b7f commit 1c0a205
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
11 changes: 8 additions & 3 deletions warehouse/cloudquery-github-resolve-repos/src/tables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,19 @@ const getRepositories = async (
const tableResolver: TableResolver = async (clientMeta, parent, stream) => {
for await (const line of input()) {
const project = JSON.parse(line) as {
slug: string;
name: string;
github: Array<{ url: string }>;
};
console.log(`Loading ${project.slug}`);
if (project.github == null) {
console.log(`skipping ${project.name}. null .github found`);
continue;
}
const projectGithub = project.github || [];

const repos = await getReposFromUrls(
client,
gh,
project.github.map((p) => p.url),
projectGithub.map((p) => p.url),
);
for (const repo of repos) {
//console.log(repo);
Expand Down
1 change: 0 additions & 1 deletion warehouse/cloudquery-github-resolve-repos/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ spec:
tables:
["*"]
destinations:
- "bigquery"
- "file"
spec:
projects_input_path: "test_only.projects.json"
Expand Down

0 comments on commit 1c0a205

Please sign in to comment.