Skip to content

GitHub Ocean examples for team, user, issues, and folder #2548

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 18 commits into
base: PORT-14552-document-github-ocean
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
e5807da
Initial version of github team example
melodyogonna Jul 14, 2025
ed3e5ed
Merge branch 'PORT-14552-document-github-ocean' of github.com:port-la…
melodyogonna Jul 14, 2025
fefde53
Remove repo team mapping for now
melodyogonna Jul 14, 2025
ad1ff4e
Add folder example as a monorepo
melodyogonna Jul 14, 2025
7ed4cc9
Add mapping for users and admins
melodyogonna Jul 14, 2025
2995ead
Update required permissions
melodyogonna Jul 14, 2025
115e42c
Use 'last' parameter to extract folder name
melodyogonna Jul 14, 2025
aab10c4
Update documentation, add issues example
melodyogonna Jul 14, 2025
b625d55
Merge branch 'PORT-14552-document-github-ocean' of github.com:port-la…
melodyogonna Jul 15, 2025
d620dcb
Merge branch 'PORT-14552-document-github-ocean' of github.com:port-la…
melodyogonna Jul 16, 2025
8606242
Add examples for mapping team and team members
melodyogonna Jul 16, 2025
58b0831
Remove unnecessary docs
melodyogonna Jul 17, 2025
816e623
Merge branch 'main' of github.com:port-labs/port-docs into PORT-14552…
melodyogonna Jul 17, 2025
27956bb
Merge branch 'PORT-14552-document-github-ocean' of github.com:port-la…
melodyogonna Jul 17, 2025
6bfb69a
Remove repository admins for now
melodyogonna Jul 17, 2025
6469908
Merge branch 'PORT-14552-document-github-ocean' of github.com:port-la…
melodyogonna Jul 17, 2025
cee462f
Add state to issue example
melodyogonna Jul 22, 2025
43cdef4
Merge branch 'PORT-14552-document-github-ocean' of github.com:port-la…
melodyogonna Jul 22, 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
@@ -1,4 +1,7 @@
- [`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)

- [`issue`](https://docs.github.com/en/rest/issues/issues#get-an-issue)
- [`folder`](https://docs.github.com/en/rest/git/trees#get-a-tree)
- [`user`](https://docs.github.com/en/rest/users/users#get-a-user)
- [`team`](https://docs.github.com/en/rest/teams/teams#get-a-team-by-name)
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<details>
<summary>Issue blueprint</summary>

```json showLineNumbers
{
"identifier": "githubIssue",
"title": "Issue",
"icon": "Github",
"schema": {
"properties": {
"creator": {
"title": "Creator",
"type": "string"
},
"assignees": {
"title": "Assignees",
"type": "array"
},
"labels": {
"title": "Labels",
"type": "array"
},
"status": {
"title": "Status",
"type": "string",
"enum": ["open", "closed"],
"enumColors": {
"open": "green",
"closed": "purple"
}
},
"createdAt": {
"title": "Created At",
"type": "string",
"format": "date-time"
},
"closedAt": {
"title": "Closed At",
"type": "string",
"format": "date-time"
},
"updatedAt": {
"title": "Updated At",
"type": "string",
"format": "date-time"
},
"description": {
"title": "Description",
"type": "string",
"format": "markdown"
},
"issueNumber": {
"title": "Issue Number",
"type": "number"
},
"link": {
"title": "Link",
"type": "string",
"format": "url"
}
},
"required": []
},
"mirrorProperties": {},
"calculationProperties": {},
"relations": {
"repository": {
"target": "githubRepository",
"required": true,
"many": false
}
}
}
```

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

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

```yaml showLineNumbers
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
url: .html_url
defaultBranch: .default_branch
- kind: issue
selector:
query: ".pull_request == null" # JQ boolean query. If evaluated to false - skip syncing the object.
state: "closed"
port:
entity:
mappings:
identifier: ".__repository + (.id|tostring)"
title: ".title"
blueprint: '"githubIssue"'
properties:
creator: ".user.login"
assignees: "[.assignees[].login]"
labels: "[.labels[].name]"
status: ".state"
createdAt: ".created_at"
closedAt: ".closed_at"
updatedAt: ".updated_at"
description: ".body"
issueNumber: ".number"
link: ".html_url"
relations:
repository: ".__repository"
```

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

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

```yaml showLineNumbers
resources:
- kind: folder
selector:
query: "true" # JQ boolean query. If evaluated to false - skip syncing the object.
folders: # Specify the repositories and folders to include under this relative path.
- path: apps/* # Relative path to the folders within the repositories.
repos: # List of repositories to include folders from.
- name: backend-service
branch: main
- name: frontend-service # if you don't specify a branch, we'll use the repository's default branch
port:
entity:
mappings:
identifier: .folder.path | split("/") | last
title: .folder.path | split("/") | last
blueprint: '"githubRepository"'
properties:
url: .__repository.html_url + "/tree/" + .__repository.default_branch + "/" + .folder.path
readme: file://README.md
```

</details>
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<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"
}
},
"required": []
},
"mirrorProperties": {},
"calculationProperties": {},
"aggregationProperties": {},
"relations": {
"admins": {
"title": "Admins",
"target": "githubUser",
"required": false,
"many": true
}
}
}
```

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

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

```yaml showLineNumbers
createMissingRelatedEntities: true
resources:
- kind: repository
selector:
query: "true"
collaborators: true
port:
entity:
mappings:
identifier: .name
title: .name
blueprint: '"githubRepository"'
properties:
readme: file://README.md
url: .html_url
defaultBranch: .default_branch
relations:
admins: "[.collaborators[] | select(.is_admin == true) | .login]"
- kind: user
selector:
query: "true"
port:
entity:
mappings:
identifier: .login
title: if (.name != "" and .name) then .name else .login end
blueprint: '"githubUser"'
relations:
user: .email
- kind: user
selector:
query: "true"
port:
entity:
mappings:
identifier: .email
title: .email
blueprint: '"user"'
relations:
user: .email
```

</details>
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<details>
<summary>Github Users blueprint</summary>

```json showLineNumbers
{
"identifier": "githubUser",
"title": "Github User",
"icon": "Microservice",
"schema": {
"properties": {
"email": {
"title": "Email",
"type": "string"
}
},
"required": []
},
"mirrorProperties": {},
"calculationProperties": {},
"aggregationProperties": {},
"relations": {
"user": {
"title": "User",
"target": "user",
"required": false,
"many": false
}
}
}
```

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

```json showLineNumbers
{
"identifier": "user",
"title": "user",
"icon": "Microservice",
"schema": {
"properties": {
"email":{
"title":"Email",
"type": "string"
}
},
"required": []
},
"mirrorProperties": {},
"calculationProperties": {},
"aggregationProperties": {},
"relations": {}
}
```

</details>
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<details>
<summary>Team Blueprint</summary>

```json showLineNumbers
{
"identifier": "githubTeam",
"title": "GitHub Team",
"icon": "Github",
"schema": {
"properties": {
"slug": {
"title": "Slug",
"type": "string"
},
"description": {
"title": "Description",
"type": "string"
},
"link": {
"title": "Link",
"icon": "Link",
"type": "string",
"format": "url"
},
"permission": {
"title": "Permission",
"type": "string"
},
"notification_setting": {
"title": "Notification Setting",
"type": "string"
},
"members": {
"title": "Members",
"type": "array"
}
},
"required": []
},
"mirrorProperties": {},
"calculationProperties": {},
"aggregationProperties": {},
"relations": {
"team_member": {
"title": "teamMember",
"target": "githubTeamMember",
"required": false,
"many": true
}
}
}
```
</details>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<details>
<summary>Team Member Blueprint </summary>

```json showLineNumbers
{
"identifier": "githubTeamMember",
"title": "Team Member",
"icon": "Github",
"schema": {
"properties": {
"all": {
"type": "object",
"title": "all"
}
},
"required": []
},
"mirrorProperties": {},
"calculationProperties": {},
"aggregationProperties": {},
"relations": {}
}
```
</details>
Loading