( integration: PlatformIntegration, repository: GitHubRepositoryReference )
| 54 | fullName: |
| 55 | repository?.full_name ?? |
| 56 | parseGitHubRepositoryFullName(thread.id) ?? |
| 57 | parseGitHubRepositoryFullName(thread.channelId), |
| 58 | }; |
| 59 | } |
| 60 | |
| 61 | export function isGitHubRepositoryLinked( |
| 62 | integration: PlatformIntegration, |
| 63 | repository: GitHubRepositoryReference |
| 64 | ): boolean { |
| 65 | if (repository.id === null && repository.fullName === null) return false; |
| 66 | |
| 67 | if (integration.repository_access === 'all') return true; |
| 68 | if (integration.repository_access !== 'selected') return false; |
| 69 | |
| 70 | const repositories = integration.repositories ?? []; |
| 71 | return repositories.some(linkedRepository => { |
| 72 | if (repository.id !== null && linkedRepository.id === repository.id) return true; |
| 73 | |
| 74 | return ( |
| 75 | repository.fullName !== null && |
| 76 | linkedRepository.full_name.toLowerCase() === repository.fullName.toLowerCase() |
| 77 | ); |
no outgoing calls
no test coverage detected