title | description | ms.custom | ms.reviewer | ms.date | ms.topic | monikerRange |
---|---|---|---|---|---|---|
Add protection to a repository resource |
Add checks and pipeline protection to a repository |
pipelinesresourcesrefresh |
vijayma |
09/15/2022 |
how-to |
>= azure-devops-2019 |
[!INCLUDE version-gt-eq-2019]
You can add protection to your repository resource with checks and pipeline permissions. When you add protection, you're better able to restrict repository ownership and editing privileges.
You must be a member of the Project Administrators group or have your Manage permissions set to Allow for Git repositories.
-
Sign in to your organization (
https://dev.azure.com/{yourorganization}
) and choose your project. -
Select Project settings > Repos.
:::image type="content" source="media/project-settings-repository.png" alt-text="Go to Repositories.":::
-
Choose the repository that you want to modify.
-
Select :::image type="icon" source="../../media/icons/more-actions.png" border="false"::: > Approvals and checks.
:::image type="content" source="../../organizations/settings/work/media/process/repository-approval.png" alt-text="Select Approvals & Checks.":::
-
Choose a check to set how your repository resource can be used, and then select Next. In the following example, we choose to add Approvals, so a manual approver for each time a pipeline requests the repository. For more information, see Approvals and checks.
:::image type="content" source="media/add-check-repository.png" alt-text="Screenshot of checks that you can add.":::
-
Configure the check in the resulting screen, and then select Create.
:::image type="content" source="media/create-check-repository.png" alt-text="Screenshot of configured check and Create button.":::
Your repository has a resource check.
You can also set a repository to only be used on specific YAML pipelines. Restricting a repository to specific pipelines prevents an unauthorized YAML pipeline in your project from using your repository. This setting only applies to YAML pipelines.
Important
Access to all pipelines is turned off for protected resources by default. To grant access to all pipelines, enter a check in the security box next to "Grant access permission to all pipelines" for the resource. You can do so when you're creating or editing a resource. You'll need to have the repository Administrator role to have this option available.
-
Sign in to your organization (
https://dev.azure.com/{yourorganization}
) and choose your project. -
Select Project settings > Repositories.
:::image type="content" source="media/project-settings-repository.png" alt-text="Go to Repositories.":::
-
Choose the repository that you want to modify.
-
Select Security.
:::image type="content" source="media/security-tab-settings.png" alt-text="Select the Security tab. ":::
-
Go to Pipeline permissions.
:::image type="content" source="media/pipeline-repository-permission.png" alt-text="Add a pipeline repository restriction.":::
-
Select :::image type="icon" source="../../media/icons/add-light-icon.png" border="false":::.
-
Choose the repository to add.
You can see the added repository listed.
[!div class="nextstepaction"] Add and use variable groups