Skip to content

Commit 5748c86

Browse files
authored
Merge pull request #3022 from port-labs/update_doc_for_ingesting_all_repos
Update GitHub Ocean Documentation for Ingesting All Repositories
2 parents d6710a9 + d87cd70 commit 5748c86

File tree

6 files changed

+34
-16
lines changed

6 files changed

+34
-16
lines changed

docs/build-your-software-catalog/sync-data-to-catalog/git/github-ocean/examples.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,13 +175,21 @@ The following example demonstrates how to ingest your GitHub repositories and th
175175

176176
To retrieve the root folders of your monorepo, use the following syntax in your `port-app-config.yml`:
177177

178-
```yaml
178+
::::info Organization and repository filtering for folders
179+
Both `organization` and `repos` under `folders` are optional. You can:
180+
- Specify only `organization`: scan all repositories in that organization for matching folders.
181+
- Specify only `repos`: scan only those repositories across accessible organizations.
182+
- Omit both: scan all accessible repositories for matching folders.
183+
Use `path` and `repositoryType` to scope results and improve performance.
184+
::::
185+
186+
```yaml showLineNumbers
179187
- kind: folder
180188
selector:
181189
query: "true" # JQ boolean query. If evaluated to false - skip syncing the object.
182190
folders: # Specify the repositories and folders to include under this relative path.
183191
- path: "*" # Relative path to the folders within the repositories.
184-
repos: # List of repositories to include folders from.
192+
repos: # Optional: list repositories to include (omit to scan all repos)
185193
- name: backend-service
186194
- name: frontend-service
187195
```

docs/build-your-software-catalog/sync-data-to-catalog/git/github-ocean/examples/example-file-kind/_file_repo_app_config.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ resources:
2525
query: 'true'
2626
files:
2727
- path: 'README.md'
28-
organization: my-org # Optional if githubOrganization is set; required if not set
29-
repos:
28+
organization: my-org # Optional if githubOrganization is set (required if not set)
29+
repos: # Optional: list repositories to include (omit to scan all repos)
3030
- name: test-repo
3131
branch: main
3232
port:

docs/build-your-software-catalog/sync-data-to-catalog/git/github-ocean/examples/example-file-kind/_package_json_app_config.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
query: 'true'
99
files:
1010
- path: '**/package.json'
11-
organization: my-org # Optional if githubOrganization is set; required if not set
11+
organization: my-org # Optional if githubOrganization is set (required if not set)
1212
repos:
1313
- name: vscode
1414
branch: main

docs/build-your-software-catalog/sync-data-to-catalog/git/github-ocean/examples/example-monorepo/_github_exporter_example_monorepo_port_app_config.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ resources:
99
query: "true" # JQ boolean query. If evaluated to false - skip syncing the object.
1010
folders: # Specify the repositories and folders to include under this relative path.
1111
- path: apps/* # Relative path to the folders within the repositories.
12-
organization: my-org # Optional if githubOrganization is set; required if not set
12+
organization: my-org # Optional if githubOrganization is set (required if not set)
1313
repos: # List of repositories to include folders from.
1414
- name: backend-service
1515
branch: main

docs/build-your-software-catalog/sync-data-to-catalog/git/github-ocean/github-ocean.md

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,19 @@ For example, say you want to manage your `package.json` files in Port. One optio
210210

211211
The following configuration fetches all `package.json` files from "MyRepo" and "MyOtherRepo", and creates an entity for each of them, based on the `manifest` blueprint:
212212

213-
:::info Organization field in file selectors
214-
The `organization` field is optional when `githubOrganization` is set in the environment variables and required when it is not provided (e.g., Classic PAT with multiple organizations defined in your port mapping).
215-
:::
213+
:::::info Organization and repository filtering
214+
Both `organization` and `repos` in file selectors are optional. You can:
215+
- Specify only `organization`: scan all repositories in that organization (respecting `repositoryType`).
216+
- Specify only `repos`: scan only those repositories across all accessible organizations.
217+
- Omit both: scan all repositories accessible to your credentials.
218+
219+
When scanning broadly, the integration scope depends on your credentials:
220+
- With GitHub App or fine‑grained PAT: all repositories in the installed/specified organization.
221+
- With classic PAT: all repositories across all organizations the token can access.
222+
Use `repositoryType` and precise `path` patterns to reduce scope.
223+
224+
Note: Omitting `organization` and `repos` will scan all accessible repositories. For large orgs, expect longer resyncs and higher GitHub API usage. Narrow scope with `repos`, `repositoryType`, and specific `path` patterns.
225+
:::::
216226

217227
<details>
218228
<summary><b>Package file mapping example (click to expand)</b></summary>
@@ -224,8 +234,8 @@ resources:
224234
files:
225235
# Note that glob patterns are supported, so you can use wildcards to match multiple files
226236
- path: '**/package.json'
227-
organization: my-org # Optional if githubOrganization is set; required if not set
228-
# The `repos` key can be used to filter the repositories and branch where files should be fetched
237+
organization: my-org # Optional, omit to scan all orgs in scope
238+
# Optional: use `repos` to filter repositories/branches (omit to scan all repos)
229239
repos:
230240
- name: MyRepo
231241
branch: main
@@ -753,8 +763,8 @@ resources:
753763
query: 'true'
754764
files:
755765
- path: '**/package.json'
756-
organization: my-org # Optional if githubOrganization is set; required if not set
757-
# Note that in this case we are fetching from a specific repository
766+
organization: my-org # Optional if githubOrganization is set (required if not set)
767+
# Optional: you can target specific repositories here (omit to scan all repos)
758768
repos:
759769
- name: MyRepo
760770
branch: main
@@ -811,9 +821,9 @@ resources:
811821
query: 'true'
812822
files:
813823
- path: values.yaml
814-
organization: my-org # Optional if githubOrganization is set; required if not set
824+
organization: my-org # Optional, omit to scan all orgs in scope
815825
skipParsing: true
816-
repos:
826+
repos: # Optional: omit to scan all repos
817827
- name: MyRepo
818828
branch: main
819829
port:

docs/build-your-software-catalog/sync-data-to-catalog/git/github-ocean/gitops/gitops.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ resources:
137137
query: 'true'
138138
files:
139139
- path: package.json
140-
organization: my-org # Optional if githubOrganization is set; required if not set
140+
organization: my-org # Optional if githubOrganization is set (required if not set)
141141
repos:
142142
- name: my-repo
143143
branch: main

0 commit comments

Comments
 (0)