Allow option to globally disable public pipelines
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Proposal
The public pipelines feature in the Project > Setting > CI/CD is default enabled. This can cause some unintended consequences (like leaked data) for customers that actively use public projects. There is currently no method for default disabling this feature or globally disabling via the admin panel.
I propose we add a section to the admin UI under Settings > CI/CD > Public Pipelines to (optionally) disable this feature globally.
Workaround for globally disabling
You can currently use the API to target the public_builds boolean value. This correlates with the public pipelines setting so can be disabled via the API on all projects using something similar to this outline:
Initialize PRIVATE_TOKEN as "YOUR_PRIVATE_TOKEN"
Initialize BASE_URL as "https://gitlab.example.com/api/v4"
# Step 1: List all public projects
1. Create a GET request to the URL constructed as BASE_URL + "/projects?visibility=public&per_page=100" with header "PRIVATE-TOKEN: PRIVATE_TOKEN"
(EX: curl --request GET --header "PRIVATE-TOKEN: $PRIVATE_TOKEN" "$BASE_URL/projects?visibility=public&per_page=100")
2. Store the response in a variable called PUBLIC_PROJECTS
# Step 2: Set the public_builds field to false for each public project
3. For each PROJECT_ID in PUBLIC_PROJECTS do the following:
Create a PUT request to the URL constructed as BASE_URL + "/projects/" + PROJECT_ID + "?public_builds=false" with header "PRIVATE-TOKEN: PRIVATE_TOKEN"
(EX: curl --request PUT --header "PRIVATE-TOKEN: $PRIVATE_TOKEN" "$BASE_URL/projects/$PROJECT_ID?public_builds=false")
4. End For