Connect GitHub CODEOWNERS with Service, Team & User
This guide demostrates how to map CODEOWNERS file in GitHub repositories to their respective Service, Team and User blueprints in port.
Prerequisites
- A Port account.
- Install Port's GitHub app in your organization or in repositories you are interested in.
Once you install Port's GitHub app, the following blueprints will be automatically created in your data model: Repository
, Pull Request
, Github User
, Github Team
.
Set up data model
First, let's create the necessary blueprint to store the Codeowners data, then we will set up the mapping configuration.
Create the Codeowners blueprint
To add the CODEOWNERS blueprint:
-
Navigate to your data model page of your portal.
-
Click on the
+ Blueprint
button. -
Click on the
Edit JSON
button. -
Copy the following definition and paste it in the editor, then click
Save
:CODEOWNERS blueprint (Click to expand)
Set up mapping configuration
-
Go to the data sources page of your portal.
-
Under
Exporters
, click on your desired GitHub organization. -
A window will open containing the default YAML configuration of your GitHub integration.
-
In the bottom-left corner you can modify the configuration to suit your needs, by adding/removing entries.
-
Copy the following configuration and paste it in the editor, then click
Save & Resync
:CODEOWNERS mapping configuration (Click to expand)
Example
For the following CODEOWNERS
file example:
CODEOWNERS file example (Click to expand)
The software catalog Codeowners page should display the corresponding Codeowners entities:
