File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed
Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change 11name : CI
22
33on :
4+ workflow_dispatch :
45 push :
56 branches : [ "**" ]
67 pull_request :
Original file line number Diff line number Diff line change @@ -33,3 +33,24 @@ dotnet publish ./Server.Stdio/Server.Stdio.csproj -c Release -r win-x64 -p:Pub
3333# macOS (unsigned)
3434dotnet publish ./Server.Stdio/Server.Stdio.csproj -c Release -r osx-arm64 -p:PublishSingleFile=true -p:SelfContained=true
3535```
36+
37+ ## Prevent merging PRs if the build fails
38+
39+ Use GitHub Branch protection rules:
40+
41+ 1 ) Trigger the CI at least once so the check appears:
42+ - Actions → CI → Run workflow (manual), or push a commit/open a PR to the protected branch.
43+ 2 ) Go to: Repository → Settings → Branches → Branch protection rules → New rule.
44+ 3 ) Branch name pattern: main (or your default branch).
45+ 4 ) Enable:
46+ - Require a pull request before merging
47+ - Require status checks to pass before merging
48+ 5 ) In “Status checks that are required”:
49+ - If populated: select “CI / build”.
50+ - If empty: type “CI / build” and add it manually.
51+ 6 ) (Optional) Also enable:
52+ - Require branches to be up to date before merging
53+ - Require approvals
54+ - Include administrators
55+
56+ After saving, PRs can’t be merged unless the “CI / build” check succeeds.
You can’t perform that action at this time.
0 commit comments