Skip to content

PORT-14552 - Docs for Github ocean integration #2494

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 175 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
175 commits
Select commit Hold shift + click to select a range
09f7849
Initial setup for Github-v2 documentation
melodyogonna May 12, 2025
2989109
Rename documentation directory to Github ocean
melodyogonna Jul 1, 2025
afdba40
Add updated example for file
melodyogonna Jul 1, 2025
4cf3344
Remove unnecessary examples for now
melodyogonna Jul 1, 2025
f8260d4
Replace Github app references
melodyogonna Jul 1, 2025
beb98ad
Merge branch 'main' into PORT-14552-document-github-ocean
mk-armah Jul 1, 2025
7644f0d
Replace gitlab references in docs
melodyogonna Jul 1, 2025
bec998d
Update docker image examples
melodyogonna Jul 1, 2025
18eb311
Continue updating file references
melodyogonna Jul 1, 2025
6b328b8
Rename examples
melodyogonna Jul 1, 2025
120c3ee
Update port exposure
melodyogonna Jul 1, 2025
dd539d9
Merge branch 'main' into PORT-14552-document-github-ocean
mk-armah Jul 2, 2025
7103fe2
revert: examples name
melodyogonna Jul 2, 2025
dc3afbb
Merge branch 'PORT-14552-document-github-ocean' of github.com:port-la…
melodyogonna Jul 2, 2025
1661758
Enable live event support in installation method
melodyogonna Jul 2, 2025
52912bc
Add monitored pr events
melodyogonna Jul 2, 2025
aa46d92
Add more supported live events
melodyogonna Jul 2, 2025
0139327
Modify organization param
melodyogonna Jul 2, 2025
d0f61e4
Add code scanning to list of app required permissions
melodyogonna Jul 2, 2025
c141d5d
Clean up document
melodyogonna Jul 2, 2025
4a2c338
Update branch mapping details
melodyogonna Jul 2, 2025
1c5d388
Update image name in the self-hosted-installation guide
melodyogonna Jul 2, 2025
a5c9d19
Update example file
melodyogonna Jul 2, 2025
e3db760
Correct docker run command
melodyogonna Jul 2, 2025
5a21ea9
small corrections
melodyogonna Jul 2, 2025
069590b
Correct link to Github documentation
melodyogonna Jul 2, 2025
b25be57
Update docker parameters
melodyogonna Jul 2, 2025
358386d
correct naming convention for integration in argocd
melodyogonna Jul 2, 2025
c464ad5
Case correction
melodyogonna Jul 2, 2025
c2c50db
Merge branch 'main' of github.com:port-labs/port-docs into PORT-14552…
melodyogonna Jul 2, 2025
1d28ecc
Trim down documentation to only documented examples
melodyogonna Jul 2, 2025
9497739
Update limitations
melodyogonna Jul 2, 2025
dc68bd4
clarify app installation page
melodyogonna Jul 2, 2025
b70e911
Fix broken link
melodyogonna Jul 2, 2025
2331752
Bump github integration version
melodyogonna Jul 2, 2025
f3a2f3e
fix: complete title with "installation" word
melodyogonna Jul 2, 2025
9d709ae
Remove hosted by port installation method
melodyogonna Jul 2, 2025
8670c82
Remove health check section
melodyogonna Jul 2, 2025
3bffbb3
Remove validation check section
melodyogonna Jul 2, 2025
32b84c3
Simplify to just "Github organization" rather than "self-hosted Github"
melodyogonna Jul 2, 2025
fbd195a
Move app installation to a subdirectory
melodyogonna Jul 2, 2025
e2986b5
Fix repository name example
melodyogonna Jul 2, 2025
8620c10
Remove setup url from app setup step
melodyogonna Jul 2, 2025
3e0024f
Add markings to two images in docs
melodyogonna Jul 2, 2025
9079e3e
Redo change to settings image
melodyogonna Jul 2, 2025
233a333
Merge branch 'main' of github.com:port-labs/port-docs into PORT-14552…
melodyogonna Jul 3, 2025
c3dc362
Update integration name in helm installation
melodyogonna Jul 3, 2025
bc0ca4a
Merge branch 'main' of github.com:port-labs/port-docs into PORT-14552…
melodyogonna Jul 7, 2025
384bf74
Add more relevant information to app creation processes
melodyogonna Jul 7, 2025
8cdb72b
Modify sample api link
melodyogonna Jul 7, 2025
71d78cb
docs: Remove cloud app permissions warning, clarify repositoryType info
melodyogonna Jul 7, 2025
4ed9aab
docs: Clarify repositoryType options in GitHub mapping example
melodyogonna Jul 7, 2025
2bd0fcb
Document repository type
melodyogonna Jul 7, 2025
7ff155f
Merge branch 'main' of github.com:port-labs/port-docs into PORT-14552…
melodyogonna Jul 7, 2025
7b8477c
Tiny correction on pull request example
melodyogonna Jul 7, 2025
51dde55
Update docker versions
melodyogonna Jul 8, 2025
5866f48
Merge branch 'main' of github.com:port-labs/port-docs into github-tea…
melodyogonna Jul 8, 2025
4a60248
Hide docs from sidebar
melodyogonna Jul 8, 2025
8bb4ffc
Merge branch 'main' into PORT-14552-document-github-ocean
mk-armah Jul 8, 2025
532a4a2
Merge branch 'PORT-14552-document-github-ocean' of github.com:port-la…
melodyogonna Jul 8, 2025
012bc41
docs: Clarify GitHub App name uniqueness in installation
melodyogonna Jul 8, 2025
82e0a47
docs: Enhance github app name description
melodyogonna Jul 8, 2025
343024c
docs: improve formatting and update permissions
melodyogonna Jul 8, 2025
e08489d
docs: Improve webhook explanation in GitHub App docs
melodyogonna Jul 8, 2025
206f557
Fix some documentation wordings
melodyogonna Jul 8, 2025
b10c2a2
Hide sidebar
melodyogonna Jul 8, 2025
64a7a49
Add workflow actions link
melodyogonna Jul 8, 2025
4278c87
docs: Add GITHUB_HOST env var and credentials tip
melodyogonna Jul 8, 2025
65d18bf
docs: Clarify GITHUB_HOST env var for GitHub Enterprise
melodyogonna Jul 8, 2025
bf189fb
Add default config
melodyogonna Jul 8, 2025
1edaea1
docs: Update description for INTEGRATION__IDENTIFIER
melodyogonna Jul 8, 2025
97a7391
docs: Improve description and remove duplicate for OCEAN__INTEGRATION…
melodyogonna Jul 8, 2025
1e2a5b7
Improve navigation order
melodyogonna Jul 8, 2025
f886627
Merge branch 'main' into PORT-14552-document-github-ocean
mk-armah Jul 8, 2025
44afc46
docs: Add Helm install steps and clarify ArgoCD placeholders in GitHu…
melodyogonna Jul 8, 2025
ed977cd
docs: Improve Helm installation steps and fix release name
melodyogonna Jul 8, 2025
8143a5b
docs: Refine placeholders in GitHub Ocean installation docs
melodyogonna Jul 8, 2025
b5e2eae
docs: Enhance note for GitHub integration ArgoCD values.yaml
melodyogonna Jul 8, 2025
4957a55
Merge branch 'PORT-14552-document-github-ocean' of github.com:port-la…
melodyogonna Jul 8, 2025
7c241fd
docs: Add Port API region tip to github app install
melodyogonna Jul 8, 2025
83a88fb
docs: Improve Docker parameters tip in GitHub App installation
melodyogonna Jul 8, 2025
f54ef54
docs: Fix placeholders and update link in GitHub App docs
melodyogonna Jul 8, 2025
e1c055b
docs: Clarify SSA requirement for GitHub App installation
melodyogonna Jul 8, 2025
bec9ae2
Improve self-service action instruction
melodyogonna Jul 8, 2025
a9a21e8
Add sample to installation guide for argocd
melodyogonna Jul 8, 2025
5e0a272
Tiny correction in wording
melodyogonna Jul 8, 2025
fa68fb3
Update image versions
melodyogonna Jul 8, 2025
9017db7
Explicitly set integration version
melodyogonna Jul 8, 2025
86ba76f
Move slash
melodyogonna Jul 9, 2025
7e4bad6
docs: Clarify webhook secret in GitHub App docs
melodyogonna Jul 9, 2025
d080d30
docs: Improve GitHub App webhook documentation
melodyogonna Jul 9, 2025
e8bc19e
Merge branch 'main' of github.com:port-labs/port-docs into PORT-14552…
melodyogonna Jul 9, 2025
2be5c88
Clarify requirements in docker parameters
melodyogonna Jul 9, 2025
6015ae1
Make the doc options and descriptions more consistent
melodyogonna Jul 9, 2025
aefc953
Update docker image versions
melodyogonna Jul 9, 2025
011e2fd
Merge branch 'main' into PORT-14552-document-github-ocean
mk-armah Jul 9, 2025
1cc3e03
Show an example of getting base64 encoded private key
melodyogonna Jul 9, 2025
539ac28
Correct the powershell command
melodyogonna Jul 9, 2025
d9409d1
chore: Add AI improvement note to GitHub token description
melodyogonna Jul 9, 2025
48c356a
docs: Specify GitHub token type and scopes
melodyogonna Jul 9, 2025
4f19d9e
Other fixes
melodyogonna Jul 9, 2025
c4e7507
Clarify baseurl
melodyogonna Jul 9, 2025
72d3532
Rearrange webhook secret to be closer to base_url
melodyogonna Jul 9, 2025
590903f
Tiny adjustment to token requirement
melodyogonna Jul 9, 2025
f3317dd
Correct word relationship placement
melodyogonna Jul 9, 2025
9b896bf
docs: Add GitHub Ocean installation methods docs
melodyogonna Jul 10, 2025
3e14989
docs: Hide Scheduled (CI) install method for app setup
melodyogonna Jul 10, 2025
eb8906f
Consolidate installation step in one component
melodyogonna Jul 10, 2025
42352ef
docs: Add docs for github app installation params
melodyogonna Jul 10, 2025
0aa5632
docs: Improve GitHub App parameter descriptions and fix typo
melodyogonna Jul 10, 2025
11f7585
docs: Add AI instruction comment for table refactor
melodyogonna Jul 10, 2025
c163b7f
refactor: Refactor parameters table into JSX component
melodyogonna Jul 10, 2025
2bb43e2
docs: add parameters table import
melodyogonna Jul 10, 2025
ad171ae
docs: Add AI task marker for table component
melodyogonna Jul 10, 2025
318b476
refactor: Move Docker parameters table to JSX component
melodyogonna Jul 10, 2025
7b298e9
docs: Conditionally show GitHub env vars in docker install table
melodyogonna Jul 10, 2025
abafe98
docs: Conditionally show env vars for docker install
melodyogonna Jul 10, 2025
bbbe142
docs: Conditionally show GitHub Ocean install parameters
melodyogonna Jul 10, 2025
2d56634
docs: Conditionally show GitHub App/PAT params in Helm install docs
melodyogonna Jul 10, 2025
1699694
fix: Correct MDX/JSX indentation in list item
melodyogonna Jul 10, 2025
6d9380b
docs: Conditionally render GitHub App/PAT params in docs table
melodyogonna Jul 10, 2025
6045596
fix(docs): Refactor conditional rendering in JSX component
melodyogonna Jul 10, 2025
3e3038e
fix: Fix broken link to github-app.md in docs
melodyogonna Jul 10, 2025
40a72a6
docs: Fix link and formatting in GitHub Ocean install docs
melodyogonna Jul 10, 2025
61bf3f2
fix: Correct MDX indentation and fix broken links
melodyogonna Jul 10, 2025
7a9ffd1
fix: Adjust highlighting comments in argocd yaml block
melodyogonna Jul 10, 2025
4d533f9
Decompose the install step into a general component
melodyogonna Jul 10, 2025
e270497
Merge branch 'main' of github.com:port-labs/port-docs into PORT-14552…
melodyogonna Jul 10, 2025
0700c7c
docs: Add live-events section to GitHub Ocean docs
melodyogonna Jul 11, 2025
23afe58
docs: Add K8s Ingress guide for GitHub Ocean live events
melodyogonna Jul 11, 2025
a7a6257
docs: Clarify GitHub webhook setup post-install
melodyogonna Jul 11, 2025
8288069
docs: Update GitHub Ocean ingress guide to use Helm chart config
melodyogonna Jul 11, 2025
3ff7b55
docs: Add Docker tab for GitHub Ocean live events setup
melodyogonna Jul 11, 2025
bd9d2ac
docs: Add Nginx reverse proxy guide for Docker install
melodyogonna Jul 11, 2025
f33365a
docs: Update Docker port mapping example in GitHub Ocean docs
melodyogonna Jul 11, 2025
bd39045
docs: Refine Docker live event docs (Ngrok/Nginx)
melodyogonna Jul 11, 2025
e646714
fix: Fix CodeBlock indentation in list to resolve MDX build error
melodyogonna Jul 11, 2025
5ca1c64
docs: Instruct AI to change code block style
melodyogonna Jul 11, 2025
05bafe5
docs: Replace CodeBlock components with markdown fences
melodyogonna Jul 11, 2025
74cafd3
Add docker run deploy step with nginx as the reverse proxy
melodyogonna Jul 11, 2025
a36988e
Add supported live event triggers
melodyogonna Jul 11, 2025
c0daf09
Link to enabling webhook section
melodyogonna Jul 12, 2025
ceb3172
Remove baseurl
melodyogonna Jul 12, 2025
c5d079c
fix: Correct helm command formatting in GitHub Ocean docs
melodyogonna Jul 12, 2025
8ecefd5
fix: Improve helm command copy-paste in docs
melodyogonna Jul 12, 2025
fe16327
docs: Add placeholders for Helm values.yaml examples in docs
melodyogonna Jul 12, 2025
bc2e662
docs: refactor GitHub Ocean Helm installation examples
melodyogonna Jul 12, 2025
07ef227
docs: Improve code block formatting in GitHub Ocean installation guide
melodyogonna Jul 12, 2025
e374b0d
docs: Refactor code blocks in GitHub Ocean installation methods
melodyogonna Jul 12, 2025
3e8d237
Make helm example use a values.yaml rather than setting all commands in
melodyogonna Jul 12, 2025
6a5eb95
Final update to webhook setup
melodyogonna Jul 12, 2025
6751899
Add an example domain
melodyogonna Jul 12, 2025
ee7d9ba
Add required permissions in PAT
melodyogonna Jul 13, 2025
2b18e92
Merge branch 'main' of github.com:port-labs/port-docs into PORT-14552…
melodyogonna Jul 13, 2025
dc707b5
Merge branch 'main' into PORT-14552-document-github-ocean
mk-armah Jul 14, 2025
6b32afc
Make supporting live-event section much smaller, remove unncessary steps
melodyogonna Jul 14, 2025
2ffd012
Merge branch 'PORT-14552-document-github-ocean' of github.com:port-la…
melodyogonna Jul 14, 2025
f7eb674
Merge branch 'main' of github.com:port-labs/port-docs into PORT-14552…
melodyogonna Jul 14, 2025
10602e7
Update image versions
melodyogonna Jul 14, 2025
734d548
docs: Unfold values.yaml code blocks
melodyogonna Jul 14, 2025
ced3dfc
docs: Add values.yaml title to Helm installation code blocks
melodyogonna Jul 14, 2025
0a15eda
docs: Add OCEAN_BASE_URL config for GitHub Ocean live events
melodyogonna Jul 15, 2025
552df67
docs: Clarify OCEAN_BASE_URL explanation
melodyogonna Jul 15, 2025
1e2cff6
docs: Clarify OCEAN_BASE_URL and add Ngrok tip for debugging
melodyogonna Jul 15, 2025
73dd824
docs: Improve clarity and conciseness of base URL tip
melodyogonna Jul 15, 2025
03d18b9
Merge branch 'main' of github.com:port-labs/port-docs into PORT-14552…
melodyogonna Jul 15, 2025
4a9f5f4
Remove members from list of repository types
melodyogonna Jul 15, 2025
4e5a9b1
Move tip
melodyogonna Jul 15, 2025
548c5f7
Correct ocean__base_url
melodyogonna Jul 16, 2025
6716207
Take out actions permission from app
melodyogonna Jul 16, 2025
c028036
Merge branch 'main' of github.com:port-labs/port-docs into PORT-14552…
melodyogonna Jul 16, 2025
b670003
Update documentation for live events
melodyogonna Jul 16, 2025
f97b297
Merge branch 'main' of github.com:port-labs/port-docs into PORT-14552…
melodyogonna Jul 17, 2025
b483f52
Add some more clarification
melodyogonna Jul 17, 2025
6d5d67e
Make it obvious that subdomain is a variable in Github enterprise cloud
melodyogonna Jul 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"label": "GitHub Self-Hosted (Beta)",
"position": 1
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
| Parameter | Description | Example | Required |
| --------- | ----------- | ------- | -------- |
| `OCEAN__INTEGRATION__CONFIG__GITHUB_TOKEN` | A GitHub Personal Access Token (PAT) to authenticate with your GitHub Organization. Only required when you're not authenticating as a [Github app](./installation/github-app.mdx) | | ✅ |
| `OCEAN__INTEGRATION__CONFIG__GTIHUB_HOST` | The API endpoint for your GitHub instance. For GitHub Enterprise Cloud, this will be `https://<org_name.ghe.com>`. Defaults to `https://api.github.com` if not provided. | | ❌ |
| `OCEAN__INTEGRATION__CONFIG__GTIHUB_ORGANIZATION` | The name of your Github organization | | ✅ |
| `OCEAN__PORT__CLIENT_ID` | Your Port client ([How to get the credentials](https://docs.port.io/build-your-software-catalog/custom-integration/api/#find-your-port-credentials)) id | | ✅ |
| `OCEAN__PORT__CLIENT_SECRET` | Your Port client ([How to get the credentials](https://docs.port.io/build-your-software-catalog/custom-integration/api/#find-your-port-credentials)) secret | | ✅ |
| `OCEAN__PORT__BASE_URL` | Your Port API URL - `https://api.getport.io` for EU, `https://api.us.getport.io` for US | | ✅ |
| `OCEAN__INITIALIZE_PORT_RESOURCES` | Default true, When set to true the integration will create default blueprints and the port App config Mapping. Read more about [initializePortResources](https://ocean.getport.io/develop-an-integration/integration-configuration/#initializeportresources---initialize-port-resources) | | ❌ |
| `OCEAN__INTEGRATION__IDENTIFIER` | The identifier of the integration that will be installed | | ❌ |
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- [`repository`](https://docs.github.com/en/rest/repos/repos#get-a-repository)
- [`pull-request`](https://docs.github.com/en/rest/pulls/pulls#get-a-pull-request)
- [`file`](/build-your-software-catalog/sync-data-to-catalog/git/github/#ingest-files-from-your-repositories)

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"label": "Examples",
"position": 2
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<details>

<summary> Port port-app-config.yml </summary>

```yaml showLineNumbers
repositoryType: 'all'
resources:
- kind: repository
selector:
query: "true" # JQ boolean query. If evaluated to false - skip syncing the object.
port:
entity:
mappings:
identifier: ".name" # The Entity identifier will be the repository name.
title: ".name"
blueprint: '"githubRepository"'
properties:
readme: file://README.md # fetching the README.md file that is within the root folder of the repository and ingesting its contents as a markdown property
url: .html_url
defaultBranch: .default_branch
- kind: pull-request
selector:
query: "true" # JQ boolean query. If evaluated to false - skip syncing the object.
state: "open"
port:
entity:
mappings:
identifier: ".head.repo.name + (.id|tostring)" # The Entity identifier will be the repository name + the pull request ID.
title: ".title"
blueprint: '"githubPullRequest"'
properties:
creator: ".user.login"
assignees: "[.assignees[].login]"
reviewers: "[.requested_reviewers[].login]"
status: ".state" # merged, closed, opened
closedAt: ".closed_at"
updatedAt: ".updated_at"
mergedAt: ".merged_at"
createdAt: ".created_at"
prNumber: ".id"
link: ".html_url"
leadTimeHours: >-
(.created_at as $createdAt | .merged_at as $mergedAt |
($createdAt | sub("\\..*Z$"; "Z") | strptime("%Y-%m-%dT%H:%M:%SZ") | mktime) as $createdTimestamp |
($mergedAt | if . == null then null else sub("\\..*Z$"; "Z") |
strptime("%Y-%m-%dT%H:%M:%SZ") | mktime end) as $mergedTimestamp |
if $mergedTimestamp == null then null else
(((($mergedTimestamp - $createdTimestamp) / 3600) * 100 | floor) / 100) end)

relations:
repository: .__repository
```

</details>
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<details>
<summary>Pull request blueprint</summary>

```json showLineNumbers
{
"identifier": "githubPullRequest",
"title": "Pull Request",
"icon": "Github",
"schema": {
"properties": {
"creator": {
"title": "Creator",
"type": "string"
},
"assignees": {
"title": "Assignees",
"type": "array"
},
"reviewers": {
"title": "Reviewers",
"type": "array"
},
"status": {
"title": "Status",
"type": "string",
"enum": ["merged", "open", "closed"],
"enumColors": {
"merged": "purple",
"open": "green",
"closed": "red"
}
},
"closedAt": {
"title": "Closed At",
"type": "string",
"format": "date-time"
},
"updatedAt": {
"title": "Updated At",
"type": "string",
"format": "date-time"
},
"mergedAt": {
"title": "Merged At",
"type": "string",
"format": "date-time"
},
"createdAt": {
"title": "Created At",
"type": "string",
"format": "date-time"
},
"link": {
"format": "url",
"type": "string"
},
"leadTimeHours": {
"title": "Lead Time in hours",
"type": "number"
}
},
"required": []
},
"mirrorProperties": {},
"calculationProperties": {
"days_old": {
"title": "Days Old",
"icon": "DefaultProperty",
"calculation": "(now / 86400) - (.properties.createdAt | capture(\"(?<date>\\\\d{4}-\\\\d{2}-\\\\d{2})\") | .date | strptime(\"%Y-%m-%d\") | mktime / 86400) | floor",
"type": "number"
}
},
"relations": {
"repository": {
"title": "Repository",
"target": "githubRepository",
"required": false,
"many": false
}
}
}
```

</details>
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<details>
<summary>Repository blueprint</summary>

```json showLineNumbers
{
"identifier": "githubRepository",
"title": "Repository",
"icon": "Microservice",
"schema": {
"properties": {
"readme": {
"title": "README",
"type": "string",
"format": "markdown"
},
"url": {
"title": "Repository URL",
"type": "string",
"format": "url"
},
"defaultBranch": {
"title": "Default branch",
"type": "string"
}
},
"required": []
},
"mirrorProperties": {},
"calculationProperties": {},
"relations": {}
}
```

</details>
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<details>
<summary>Package blueprint</summary>

```json showLineNumbers
{
"identifier": "package",
"title": "Package",
"icon": "Package",
"schema": {
"properties": {
"package": {
"icon": "DefaultProperty",
"type": "string",
"title": "Package"
},
"version": {
"icon": "DefaultProperty",
"type": "string",
"title": "Version"
}
},
"required": [
"package",
"version"
]
},
"mirrorProperties": {},
"calculationProperties": {},
"aggregationProperties": {},
"relations": {}
}
```

</details>
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<details>

<summary>Port config YAML</summary>

```yaml showLineNumbers
- kind: file
selector:
query: 'true'
files:
- path: package.json
repos:
- name: vscode
branch: main
port:
itemsToParse: .content.dependencies | to_entries
entity:
mappings:
identifier: >-
.item.key + "_" + if (.item.value | startswith("^")) then
.item.value[1:] else .item.value end
title: .item.key + "@" + .item.value
blueprint: '"package"'
properties:
package: .item.key
version: .item.value
```

</details>
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
---
sidebar_position: 2
---

import RepositoryBlueprint from './\_github_exporter_example_repository_blueprint.mdx'
import PRBlueprint from './\_github_exporter_example_pull_request_blueprint.mdx'
import PortAppConfig from './\_github_exporter_example_port_app_config.mdx'
import GitHubResources from '../\_github_exporter_supported_resources.mdx'

import PackageBlueprint from './example-file-kind/\_example_package_blueprint.mdx'
import PackageAppConfig from './example-file-kind/\_package_json_app_config.mdx'


# Resource mapping examples


## Map repositories and pull requests

In the following example you will ingest your GitHub repositories, their README.md file contents and open pull requests to Port, you may use the following Port blueprint definitions and `port-app-config.yml`:

<RepositoryBlueprint/>

<PRBlueprint/>

:::info repository type

The `repositoryType` parameter filters which repositories are ingested. It corresponds to the `type` parameter in GitHub's [List organization repositories](https://docs.github.com/en/rest/repos/repos?apiVersion=2022-11-28#list-organization-repositories) API.

<details>
<summary>Possible values:</summary>

* `all` (default): All repositories accessible to the provided token.
* `public`: Public repositories.
* `private`: Private repositories.
* `forks`: Only forked repositories.
* `sources`: Only non-forked repositories.
</details>

:::

<PortAppConfig/>

:::tip learn more

- We leverage [JQ JSON processor](https://stedolan.github.io/jq/manual/) to map and transform GitHub objects to Port Entities.
- Click [Here](https://docs.github.com/en/rest/repos/repos#get-a-repository) for the GitHub repository object structure.
- Click [Here](https://docs.github.com/en/rest/pulls/pulls#get-a-pull-request) for the GitHub pull request object structure.

:::

After creating the blueprints and committing the `port-app-config.yml` file to your `.github-private` repository (for global configuration), or to any specific repositories (for per-repo configuration), you will see new entities in Port matching your repositories alongside their README.md file contents and pull requests. (Remember that the `port-app-config.yml` file has to be in the **default branch** of the repository to take effect).

## Map files and file contents

The following example demonstrates ingestion of dependencies from a `package.json` file in your repository into Port:

<PackageBlueprint />
<PackageAppConfig />

The example will parse the `package.json` file in your repository and extract the dependencies into Port entities.
For more information about ingesting files and file contents, click [here](/build-your-software-catalog/sync-data-to-catalog/git/github-ocean/#ingest-files-from-your-repositories).



## Map supported resources

The examples above show specific use cases, but Port's GitHub integration supports the ingestion of many other GitHub objects.
To adapt the examples above, use the GitHub API reference to learn about the available fields for the different supported objects:

<GitHubResources/>

When adding the ingestion of other resources, remember to add an entry to the `resources` array and change the value provided to the `kind` key accordingly.
Loading