diff --git a/.github/workflows/branch-enforcer.yml b/.github/workflows/branch-enforcer.yml new file mode 100644 index 00000000..6e7b2caa --- /dev/null +++ b/.github/workflows/branch-enforcer.yml @@ -0,0 +1,16 @@ +# Check that the only branch that can merge to "main" is "dev" + +name: "Check Branch" + +on: + pull_request: + +jobs: + check_branch: + runs-on: ubuntu-latest + steps: + - name: Check branch + if: github.base_ref == 'main' && github.head_ref != 'dev' + run: | + echo "ERROR: Can only merge to main branch from dev branch" + exit 1 diff --git a/Mathematics.NET.sln b/Mathematics.NET.sln index f15301bf..907ab674 100644 --- a/Mathematics.NET.sln +++ b/Mathematics.NET.sln @@ -28,13 +28,14 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{9EB2 EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{1B32D7FF-257B-49BB-B495-D64E5E6C4C82}" ProjectSection(SolutionItems) = preProject + branch-enforcer.yml = branch-enforcer.yml .github\workflows\codeql.yml = .github\workflows\codeql.yml .github\workflows\generate-documentation-site.yml = .github\workflows\generate-documentation-site.yml EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mathematics.NET.DevApp", "src\Mathematics.NET.DevApp\Mathematics.NET.DevApp.csproj", "{89C3482F-0027-483E-AAD7-5E12453915B3}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mathematics.NET.Renderer", "src\Mathematics.NET.Renderer\Mathematics.NET.Renderer.csproj", "{94744B01-DD3C-4623-992F-19C5CC2B475B}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mathematics.NET.Renderer", "src\Mathematics.NET.Renderer\Mathematics.NET.Renderer.csproj", "{94744B01-DD3C-4623-992F-19C5CC2B475B}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution