ADR Suggestion Branch protection rulesets (master, develop, gh-pages)
#45
AndrewSazonov
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
|
It would be awesome to try to automate those tasks, as they are long and tedious. Maybe add a post-generation task which configures rulesets on new repo creation? # copier.yaml
_tasks:
- "gh api -X POST /easyscience/{{ project_name }}/rulesets --input .github/rulesets/master.json"with master.json like {
"name": "master branch protection",
"target": "branch",
"enforcement": "active",
"conditions": {
"ref_name": {
"include": ["~DEFAULT_BRANCH"],
"exclude": []
}
},
"rules": [
{"type": "deletion"},
{"type": "non_fast_forward"},
{"type": "pull_request",
"parameters": {"allowed_merge_methods": ["merge"],
"dismiss_stale_reviews_on_push": false,
"require_code_owner_review": false,
"require_last_push_approval": false,
"required_approving_review_count": 0,
"required_review_thread_resolution": false
}}
]
} |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
To keep our repositories consistent and avoid accidental history rewrites, we need a simple and predictable branch-protection setup:
Should only receive changes via pull requests and preserve full merge history (merge-only PRs).
Should stay clean and linear and is the main integration branch for feature work (squash-only PRs).
The
gh-pagesbranch is reserved exclusively for built documentation and must not be modified manually.It is updated automatically by the documentation CI workflow.
The branching strategy itself is described in a separate ADR:
https://github.com/orgs/easyscience/discussions/12
Rulesets should be created only after the target branches exist.
GitHub rulesets must be configured per repository:
https://github.com/easyscience/REPOSITORY/settings/rules
Configuration steps
1) Ruleset: master branch protection
master branch protection2) Ruleset: develop branch protection
develop branch protectiondevelop(required for automation such as master → develop backmerge workflows)
3) Ruleset: gh-pages branch protection
gh-pages branch protectiongh-pages4) Ruleset: release tags protection
release tags protectionv*Beta Was this translation helpful? Give feedback.
All reactions