Skip to content

Conversation

lbussell
Copy link
Contributor

This PR is dotnet/dotnet-docker#6713 but moved to the correct repo.
I addressed the review feedback from dotnet/dotnet-docker#6713 (comment) in a new commit.

This PR also fixes #1795 by removing the branch override feature as suggested in #1795 (comment).

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR modifies the branch validation logic to allow official build and publish pipelines to run on internal/release/ branches. The changes reorganize the validation steps to check official repo prefixes first, then official branches, and finally official branch prefixes instead of relying on a branch override feature.

Key changes:

  • Restructures validation logic to check conditions in a cleaner order
  • Adds support for official branch prefixes to allow internal/release/ branches
  • Removes the branch override feature that was causing issues

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +32 to +37
foreach ($prefix in "$(officialBranchPrefixes)".Split(',')) {
if ("$(sourceBranch)".StartsWith($prefix)) {
$hasOfficialBranchPrefix = $true
break
}
}
Copy link

Copilot AI Oct 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The loop iterates through all prefixes even after finding a match. Consider adding trimming to handle potential whitespace in the comma-separated list, as Split(',') doesn't remove leading/trailing spaces from individual elements.

Copilot uses AI. Check for mistakes.

@lbussell lbussell merged commit 46e34e7 into dotnet:main Oct 13, 2025
20 checks passed
@lbussell lbussell deleted the fix-branch-validation branch October 13, 2025 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Branch validation override not working

2 participants