Skip to main content
Version: 1.0.0

Task 03: Configure Project Settings

Runbook GitHub GitLab Azure DevOps

DOCUMENT CATEGORY: Runbook Step
SCOPE: Source control project configuration
PURPOSE: Configure repository settings, branch protection, and merge/pull request approvals MASTER REFERENCE: Azure DevOps Project Settings

Status: Active


Objective

Configure required settings for the source control project. Most settings are replicated from the template, but must be verified. Select your platform below for platform-specific instructions.


Prerequisites

  • Source control project created (Task 02)
  • Admin / Maintainer role in the project

Procedure

Branch Protection

Protect the main branch to prevent direct pushes and require reviews before merging.

  1. Navigate to SettingsBranches
  2. Click Add branch protection rule
  3. Set Branch name pattern to main
  4. Enable the following:
SettingValue
Require a pull request before merging
Require approvals✅ (see Approval Rules below)
Dismiss stale pull request approvals when new commits are pushed
Require status checks to pass before merging
Require conversation resolution before merging
Do not allow bypassing the above settings
Restrict who can push to matching branches✅ (No direct pushes)
Allow force pushes❌ Disabled
Allow deletions❌ Disabled
  1. Click Save changes

References: GitHub — Branch protection rules

Push Rules / Security Settings

GitHub handles push security via branch protection (configured above) and repository settings:

  1. Navigate to SettingsCode security and analysis
  2. Enable:
    • Secret scanning — detect committed secrets
    • Push protection — block pushes containing secrets
  3. Navigate to SettingsGeneralPull Requests
    • ✅ Allow squash merging (set default commit message)
    • ❌ Disable merge commits and rebase merging (optional — enforce squash)

Merge / Pull Request Approvals

Configure required approvals in SettingsBranches → branch protection rule for main:

Project TypeRequired ApprovalsReviewers
Sandbox/Lab0
Core repos3@AzureLocal/cicd team
Deployment repos2@AzureLocal/pcie team
All others2@AzureLocal/cicd team

Optionally, add a CODEOWNERS file to the repository root to auto-assign reviewers:

CODEOWNERS
# Default reviewers for all files
* @AzureLocal/cicd

References: GitHub — CODEOWNERS


Verification

  • main branch protected — no direct pushes allowed
  • Push rules / security scanning configured
  • Merge/PR approval rules added with correct reviewer counts
  • Squash merge enforced (or preferred merge strategy set)

Next Steps

Create Environments


References


Variables from variables.yml

VariableConfig PathExample
Default Branchcicd.project.default_branchmain
Branch Policycicd.project.branch_policyrequire-pr
Pipeline Pathcicd.project.pipeline_path/pipelines

Toolkit Reference

Scripts for this task are located in the azurelocal-toolkit repository under scripts/deploy/ in the appropriate task folder.


Alternatives

The procedures in this task use the scripted methods shown in the tabs above. Additional deployment methods including Azure CLI and Bash scripts are available in the azurelocal-toolkit repository under scripts/deploy/.

MethodDescription
Azure CLIPowerShell-based Azure CLI scripts for Azure resource operations
BashLinux/macOS compatible shell scripts for pipeline environments
PreviousUpNext
← Task 02: Create source control projectPhase 01: CI/CD SetupTask 04: Create Environments ->

Troubleshooting

IssueCauseResolution
Branch policies not applyingInsufficient project admin permissionsVerify user has Project Administrator role
Pipeline configuration failsInvalid YAML syntax in pipeline definitionValidate YAML syntax using pipeline editor

Version Control

VersionDateAuthorChanges
1.0.02025-03-25Azure Local CloudInitial release