Skip to content

Commit

Permalink
Add workflow file
Browse files Browse the repository at this point in the history
- Add workflow to check that the only branch that can merge to main is dev
  • Loading branch information
HamletTanyavong committed Oct 22, 2023
1 parent beed379 commit db56876
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
16 changes: 16 additions & 0 deletions .github/workflows/branch-enforcer.yml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 2 additions & 1 deletion Mathematics.NET.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit db56876

Please sign in to comment.