You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/contributing/github_actions_setup.md
+31-1Lines changed: 31 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,5 +27,35 @@ Pypi authorization must be setup following the procedure in the following docume
27
27
Trestle supports releasing patches from maintenance branches (e.g., `v3`, `v4`). When creating a new maintenance branch, the following GitHub configuration is required:
28
28
29
29
-**Branch protection**: Create a ruleset for `v[0-9]*` branches requiring PR reviews, status checks, squash merges, and restricted push access. See [Maintenance releases](maintenance_releases.md) for details.
30
-
-**Release environment**: The `release` environment's deployment branch rules must include maintenance branches (add `v*` pattern or list branches explicitly).
30
+
-**Release environment**: Add the specific maintenance branch to the `release` environment's deployment branch rules. See [Adding a branch to the release environment](#adding-a-branch-to-the-release-environment) below.
31
31
-**PyPI trusted publisher**: Verify the trusted publisher configuration does not restrict publishing to `main` only.
32
+
33
+
### Adding a branch to the release environment
34
+
35
+
When cutting a new major version (e.g., v5.0.0), add the previous major version's maintenance branch (e.g., `v4`) to the `release` GitHub Environment. Each branch must be added **individually by exact name** (not using wildcards) to require deliberate opt-in for new maintenance branches.
36
+
37
+
#### Using the GitHub UI
38
+
39
+
1. Navigate to **Settings** → **Environments** → **release**
40
+
1. Under **Deployment branches and tags**, click **Add deployment branch or tag rule**
41
+
1. Select **Branch** as the rule type
42
+
1. Enter the exact branch name: `v4` (not `v*` or `v[0-9]*`)
43
+
1. Click **Add rule**
44
+
45
+
#### Using the GitHub CLI
46
+
47
+
```bash
48
+
gh api repos/oscal-compass/compliance-trestle/environments/release/deployment-branch-policies \
49
+
--method POST -f name='v4' -f type='branch'
50
+
```
51
+
52
+
#### Verifying the configuration
53
+
54
+
List all deployment branches to confirm the new branch was added:
55
+
56
+
```bash
57
+
gh api repos/oscal-compass/compliance-trestle/environments/release/deployment-branch-policies \
58
+
--jq '.branch_policies[] | {name, type}'
59
+
```
60
+
61
+
Expected output should include entries for `main` and all active maintenance branches (e.g., `v3`, `v4`).
Copy file name to clipboardExpand all lines: docs/contributing/maintenance_releases.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -91,7 +91,7 @@ When a new major version is released (e.g., v5.0.0), create a maintenance branch
91
91
- Restrict push access to maintainers
92
92
- Disallow force pushes and deletions
93
93
94
-
1.**Update the GitHub `release` environment**if it uses an explicit branch list (add the new branch)
94
+
1.**Add the new branch to the `release` environment**— each maintenance branch must be explicitly allowed for deployments. Follow the step-by-step instructions in [GitHub actions setup → Adding a branch to the release environment](github_actions_setup.md#adding-a-branch-to-the-release-environment).
95
95
96
96
1.**Consider enabling Dependabot** for security updates on the new maintenance branch
0 commit comments