Skip to content

Commit c35af1f

Browse files
feat: sanitize GitHub user identifiers to handle special characters
Signed-off-by: Dennis Bilson <dennis.bilson@port.io>
1 parent 49f3d30 commit c35af1f

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
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: .creator.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-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)