Skip to content

Commit f6eaccd

Browse files
Updated identifier JQ to handle bot username mapping properly
1 parent 6bd4acf commit f6eaccd

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ resources:
3030
title: ".title"
3131
blueprint: '"githubPullRequest"'
3232
properties:
33-
creator: .user.login
34-
assignees: "[.assignees[].login]"
35-
reviewers: "[.requested_reviewers[].login]"
33+
creator: .user.login | gsub("\\["; "-") | gsub("\\](?=[^$])"; "-") | gsub("\\]$"; "")
34+
assignees: "[.assignees[].login | gsub("\\["; "-") | gsub("\\](?=[^$])"; "-") | gsub("\\]$"; "")]"
35+
reviewers: "[.requested_reviewers[].login | gsub("\\["; "-") | gsub("\\](?=[^$])"; "-") | gsub("\\]$"; "")]"
3636
status: ".state" # merged, closed, opened
3737
closedAt: ".closed_at"
3838
updatedAt: ".updated_at"

docs/build-your-software-catalog/sync-data-to-catalog/git/github-ocean/examples/example-repository-admins/_github_exporter_example_admins_users_port_app_config.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ resources:
2323
url: .html_url
2424
defaultBranch: .default_branch
2525
relations:
26-
admins: "[.__collaborators[] | select(.is_admin == true) | .login]"
26+
admins: "[.__collaborators[] | select(.is_admin == true) | .login | gsub("\\["; "-") | gsub("\\](?=[^$])"; "-") | gsub("\\]$"; "")]"
2727
- kind: user
2828
selector:
2929
query: "true"
3030
includeBots: "false"
3131
port:
3232
entity:
3333
mappings:
34-
identifier: .login
34+
identifier: .login | gsub("\\["; "-") | gsub("\\](?=[^$])"; "-") | gsub("\\]$"; "")
3535
title: if (.name != "" and .name) then .name else .login end
3636
blueprint: '"githubUser"'
3737
relations:

docs/build-your-software-catalog/sync-data-to-catalog/git/github-ocean/examples/example-team-members/_github_team_member_port_app_config.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
permission: .permission
2020
notification_setting: .notificationSetting
2121
relations:
22-
team_member: '[.members.nodes[].login]'
22+
team_member: '[.members.nodes[].login | gsub("\\["; "-") | gsub("\\](?=[^$])"; "-") | gsub("\\]$"; "")]'
2323
- kind: team
2424
selector:
2525
query: 'true'
@@ -28,7 +28,7 @@
2828
itemsToParse: .members.nodes
2929
entity:
3030
mappings:
31-
identifier: .login
31+
identifier: .login | gsub("\\["; "-") | gsub("\\](?=[^$])"; "-") | gsub("\\]$"; "")
3232
title: .login
3333
blueprint: '"githubTeamMember"'
3434
properties:

0 commit comments

Comments
 (0)