dotnet / docker-tools

This is a repo to house some common tools for our various docker repos.
MIT License
122 stars 46 forks source link

Branch validation can't be overridden #1351

Closed mthalman closed 2 months ago

mthalman commented 3 months ago

The branch validation logic has an issue that doesn't allow the check to be overridden.

https://github.com/dotnet/docker-tools/blob/eb406de4f0e3bafaebf1026fe206a17880567a17/eng/common/templates/steps/validate-branch.yml#L7-L28

I ran a build from an unofficial branch and set overrideOfficialBranchValidation as a variable but I still got the Official builds must be done from an official branch error.

dotnet-issue-labeler[bot] commented 3 months ago

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

dotnet-issue-labeler[bot] commented 3 months ago

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

lbussell commented 2 months ago

This is because the variable is hard-coded into the pipeline:

https://github.com/dotnet/docker-tools/blob/6d3f697c41460c5fbc82bdd7bd477a02ddccb0e2/eng/common/templates/variables/common.yml#L35-L36

It should be removed, since hard-coded variables like that can't be overridden from the UI AFAIK.