Skip to content

Commit 698ed48

Browse files
[sync] Create .github/settings.yml
1 parent 7555ab0 commit 698ed48

1 file changed

Lines changed: 284 additions & 0 deletions

File tree

‎.github/settings.yml‎

Lines changed: 284 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,284 @@
1+
# ----------------------------------------------------------------
2+
# Auto-merged from nsheaps/.github on every sync.
3+
# Source: https://github.com/nsheaps/.github/blob/6133faed3e0ec6fd17848fdc826a0b80426f664e/.github/repo-settings.yaml
4+
# Edits to this file are KEPT on the next sync (deep merge).
5+
# To remove an org default, delete the key here — it will not come back.
6+
# ----------------------------------------------------------------
7+
# ----------------------------------------------------------------
8+
# nsheaps org-wide repository defaults — TEMPLATE
9+
#
10+
# This file is the source of truth. It contains ${ENV_VAR} placeholders
11+
# that get substituted by the render-repo-settings workflow (envsubst),
12+
# which writes the rendered output to repo-settings.yaml in this repo.
13+
# Edit this file (not repo-settings.yaml) for org-wide changes.
14+
#
15+
# Render workflow:
16+
# https://github.com/nsheaps/.github/blob/main/.github/workflows/render-repo-settings.yaml
17+
#
18+
# After rendering, the resolved repo-settings.yaml is deep-merged into
19+
# each managed repo's .github/settings.yml by sync-repo-settings:
20+
# https://github.com/nsheaps/.github/blob/main/.github/workflows/sync-repo-settings.yaml
21+
#
22+
# Merger script + tests:
23+
# https://github.com/nsheaps/.github/blob/main/scripts/repo_settings_merge.py
24+
#
25+
# Merge semantics — short version:
26+
# - scalars : target wins (repo's existing value preserved)
27+
# - mappings : recurse
28+
# - rulesets[] : matched by `name`, deep-merged per item
29+
# - rulesets[].rules[] : matched by `type`, deep-merged per item
30+
# - bypass_actors[] : matched by (actor_id, actor_type) — SOURCE wins on scalars
31+
# - enforcement omitted : normalized to `active` at write time
32+
#
33+
# Do not set per-repo identity (name/description/homepage/topics) here —
34+
# those belong to each repo.
35+
#
36+
# `# @default` convention: lines tagged `# @default` are uncommented ONLY
37+
# on a repo's FIRST sync (when it has no settings.yml yet). After that the
38+
# commented source line is invisible to deep-merge, so a later change to
39+
# the commented value can't accidentally overwrite the repo's value.
40+
# ----------------------------------------------------------------
41+
42+
# These settings affect the repository itself.
43+
# See https://docs.github.com/en/rest/repos/repos#update-a-repository
44+
repository:
45+
# NOTE: We deliberately do NOT set `name`, `description`, `homepage`,
46+
# or `topics` from the org defaults — those belong to each repo.
47+
# Edit them directly in your repo's .github/settings.yml.
48+
#
49+
# The booleans below are commented with `# @default` — they're set on
50+
# this repo's FIRST sync only. After that, your value wins; org changes
51+
# to the commented line are invisible to subsequent merges.
52+
53+
# A short description of the repository that will show up on GitHub
54+
# description: ...
55+
56+
# A URL with more information about the repository
57+
# homepage: https://example.github.io/
58+
59+
# A comma-separated list of topics to set on the repository
60+
# topics: ...
61+
62+
# Either `true` to make the repository private, or `false` to make it public.
63+
# NOTE: intentionally not set org-wide — public/private is a per-repo decision.
64+
# private: false
65+
66+
# Either `true` to enable issues for this repository, `false` to disable them.
67+
has_issues: true
68+
69+
# Either `true` to enable projects for this repository, or `false` to disable them.
70+
# NOTE: We use org-level projects, not repo-level.
71+
has_projects: false
72+
73+
# Either `true` to enable the wiki for this repository, `false` to disable it.
74+
has_wiki: false
75+
76+
# Either `true` to enable downloads for this repository, `false` to disable them.
77+
has_downloads: false
78+
79+
# Updates the default branch for this repository.
80+
default_branch: main
81+
82+
# Either `true` to allow squash-merging pull requests, or `false` to prevent
83+
# squash-merging.
84+
allow_squash_merge: true
85+
86+
# Either `true` to allow merging pull requests with a merge commit, or `false`
87+
# to prevent merging pull requests with merge commits.
88+
allow_merge_commit: false
89+
90+
# Either `true` to allow rebase-merging pull requests, or `false` to prevent
91+
# rebase-merging.
92+
allow_rebase_merge: true
93+
94+
# Either `true` to enable automatic deletion of branches on merge, or `false`
95+
# to disable.
96+
delete_branch_on_merge: true
97+
98+
# Either `true` to allow auto-merge on pull requests, or `false` to disallow.
99+
allow_auto_merge: true
100+
101+
# The default value for a squash merge commit title:
102+
# - PR_TITLE — default to the pull request's title
103+
# - COMMIT_OR_PR_TITLE — default to the commit's title (if only one commit)
104+
# or the pull request's title (when more than one commit)
105+
squash_merge_commit_title: PR_TITLE
106+
107+
# The default value for a squash merge commit message:
108+
# - PR_BODY — default to the pull request's body
109+
# - COMMIT_MESSAGES — default to the branch's commit messages
110+
# - BLANK — default to a blank commit message
111+
squash_merge_commit_message: PR_BODY
112+
113+
# Labels: managed centrally via .github/labels.yaml + sync-labels workflow.
114+
# Intentionally omitted here so the two sources don't fight.
115+
116+
# Rulesets — repository-level branch/tag rulesets.
117+
# Docs: https://github.com/repository-settings/app/blob/master/docs/plugins/rulesets.md
118+
# API : https://docs.github.com/en/rest/repos/rules
119+
#
120+
# enforcement values:
121+
# - active : rules are enforced
122+
# - disabled : ruleset exists but is not enforced (dormant)
123+
# - evaluate : rules are checked and reported but not enforced (preview)
124+
# NOTE: If `enforcement` is omitted on a ruleset, the sync writer fills it
125+
# with `active`. Each ruleset below either:
126+
# - sets `enforcement: active` (always-on org policy — overriding is discouraged), or
127+
# - sets `enforcement: disabled` plus a commented `# enforcement: 'active'`
128+
# sibling that a repo can uncomment (and delete the disabled line) to enable, or
129+
# - omits `enforcement` and provides a commented `# enforcement: 'active'`
130+
# hint that a repo can uncomment to lock the ruleset on explicitly.
131+
#
132+
# bypass_actors[].bypass_mode values:
133+
# - always : prompts the user to bypass at push/merge time (GitHub UI default)
134+
# - pull_request : bypass only allowed via a PR (push-time bypass blocked)
135+
# NOTE: omitting bypass_mode lets the merger fill `always`.
136+
#
137+
# Every ruleset seeds repo admins (RepositoryRole id 5) as bypass actors so
138+
# the org doesn't lock admins out. Repos can append more bypass_actors; for
139+
# the admin entry itself, source-wins (you can't silently widen admin bypass
140+
# to `always` if the org set `pull_request`).
141+
rulesets:
142+
# ---- 1. No delete / no force-push on the default branch ----
143+
- name: protect-default-branch
144+
target: branch
145+
enforcement: active # always enforced — overriding this is discouraged
146+
conditions:
147+
ref_name:
148+
include:
149+
- "~DEFAULT_BRANCH" # special selector: whatever the default branch is
150+
exclude: []
151+
bypass_actors:
152+
# Repo admins can bypass (always = prompts at push/merge time, not silent exempt).
153+
# Repos can add more actors (other teams, integrations).
154+
- actor_id: 5
155+
actor_type: RepositoryRole # 1=read 2=triage 3=write 4=maintain 5=admin
156+
bypass_mode: always
157+
# automation-nsheaps GitHub App — actor_id is substituted from 2549081
158+
# by render-repo-settings when this template is rendered to repo-settings.yaml.
159+
- actor_id: 2549081
160+
actor_type: Integration
161+
bypass_mode: always
162+
rules:
163+
- type: deletion # block branch deletion
164+
- type: non_fast_forward # block force-push
165+
166+
# ---- 2. PR required (0 reviews) ----
167+
- name: require-pr
168+
target: branch
169+
# enforcement: 'active' # uncomment to lock this ruleset on in this repo
170+
conditions:
171+
ref_name:
172+
include: ["~DEFAULT_BRANCH"]
173+
exclude: []
174+
bypass_actors:
175+
# Repo admins can bypass (always = prompts at push/merge time, not silent exempt).
176+
# Repos can add more actors (other teams, integrations).
177+
- actor_id: 5
178+
actor_type: RepositoryRole # 1=read 2=triage 3=write 4=maintain 5=admin
179+
bypass_mode: always
180+
# automation-nsheaps GitHub App — actor_id is substituted from 2549081
181+
# by render-repo-settings when this template is rendered to repo-settings.yaml.
182+
- actor_id: 2549081
183+
actor_type: Integration
184+
bypass_mode: exempt
185+
rules:
186+
- type: pull_request
187+
# parameters:
188+
# Possible additional parameters (commented for repos to opt in):
189+
# required_approving_review_count: 0
190+
# dismiss_stale_reviews_on_push: false
191+
# require_code_owner_review: false
192+
# require_last_push_approval: false
193+
# required_review_thread_resolution: false
194+
# allowed_merge_methods: [merge, squash, rebase]
195+
196+
# ---- 3. Checks required ----
197+
# NOTE: shipped ACTIVE with an empty required_status_checks list — a valid
198+
# GitHub config that's a no-op until a repo populates the list. Repos just
199+
# add entries under required_status_checks below; no enforcement flip needed.
200+
# The org doesn't mandate specific status checks (each repo has its own CI),
201+
# which is why the list is empty here.
202+
enforcement: active
203+
- name: require-checks
204+
target: branch
205+
enforcement: active
206+
conditions:
207+
ref_name:
208+
include: ["~DEFAULT_BRANCH"]
209+
exclude: []
210+
bypass_actors:
211+
# Repo admins can bypass (always = prompts at push/merge time, not silent exempt).
212+
# Repos can add more actors (other teams, integrations).
213+
- actor_id: 5
214+
actor_type: RepositoryRole # 1=read 2=triage 3=write 4=maintain 5=admin
215+
bypass_mode: always
216+
# automation-nsheaps GitHub App — actor_id is substituted from 2549081
217+
# by render-repo-settings when this template is rendered to repo-settings.yaml.
218+
- actor_id: 2549081
219+
actor_type: Integration
220+
bypass_mode: always
221+
rules:
222+
- type: required_status_checks
223+
parameters:
224+
strict_required_status_checks_policy: true
225+
required_status_checks: [] # ← repos add { context, integration_id } entries
226+
227+
# ---- 4. Review required — 1 reviewer (active by default) ----
228+
- name: require-1-review
229+
target: branch
230+
# enforcement: 'active' # uncomment to lock this ruleset on in this repo
231+
conditions:
232+
ref_name:
233+
include: ["~DEFAULT_BRANCH"]
234+
exclude: []
235+
bypass_actors:
236+
# Repo admins can bypass (always = prompts at push/merge time, not silent exempt).
237+
# Repos can add more actors (other teams, integrations).
238+
- actor_id: 5
239+
actor_type: RepositoryRole # 1=read 2=triage 3=write 4=maintain 5=admin
240+
bypass_mode: always
241+
# automation-nsheaps GitHub App — actor_id is substituted from 2549081
242+
# by render-repo-settings when this template is rendered to repo-settings.yaml.
243+
- actor_id: 2549081
244+
actor_type: Integration
245+
bypass_mode: exempt
246+
rules:
247+
- type: pull_request
248+
parameters:
249+
required_approving_review_count: 1
250+
dismiss_stale_reviews_on_push: true
251+
require_last_push_approval: false
252+
required_review_thread_resolution: true
253+
254+
# ---- 5. Review required — 1 reviewer from CODEOWNERS (disabled by default) ----
255+
# NOTE: shipped DISABLED. Repos with a meaningful CODEOWNERS file flip to
256+
# `enforcement: active` and likely set `require-1-review.enforcement: disabled`
257+
# so the two don't double up.
258+
enforcement: active
259+
- name: require-codeowner-review
260+
target: branch
261+
enforcement: disabled
262+
# enforcement: 'active' # uncomment (and remove the disabled line above) to enable
263+
conditions:
264+
ref_name:
265+
include: ["~DEFAULT_BRANCH"]
266+
exclude: []
267+
bypass_actors:
268+
# Repo admins can bypass (always = prompts at push/merge time, not silent exempt).
269+
# Repos can add more actors (other teams, integrations).
270+
- actor_id: 5
271+
actor_type: RepositoryRole # 1=read 2=triage 3=write 4=maintain 5=admin
272+
bypass_mode: always
273+
# automation-nsheaps GitHub App — actor_id is substituted from 2549081
274+
# by render-repo-settings when this template is rendered to repo-settings.yaml.
275+
- actor_id: 2549081
276+
actor_type: Integration
277+
bypass_mode: exempt
278+
rules:
279+
- type: pull_request
280+
parameters:
281+
required_approving_review_count: 1
282+
require_code_owner_review: true
283+
dismiss_stale_reviews_on_push: true
284+
required_review_thread_resolution: true

0 commit comments

Comments
 (0)