Skip to content

Commit 0b4d965

Browse files
Add workflow_dispatch trigger to CI and document branch protection rules
1 parent 2c32ed1 commit 0b4d965

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: CI
22

33
on:
4+
workflow_dispatch:
45
push:
56
branches: [ "**" ]
67
pull_request:

docs/CI-CD.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,24 @@ dotnet publish ./Server.Stdio/Server.Stdio.csproj -c Release -r win-x64 -p:Pub
3333
# macOS (unsigned)
3434
dotnet 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.

0 commit comments

Comments
 (0)