Skip to content

Commit a6da086

Browse files
authored
Merge branch 'main' into feat/renovate
2 parents 9694ed9 + 240a9d9 commit a6da086

5 files changed

Lines changed: 93 additions & 10 deletions

File tree

.github/pull_request_template.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
## What changed and why
2+
3+
## Dry-run result
4+
5+
- [ ] Triggered:
6+
`gh workflow run safe-settings-sync.yml --repo IntegratedDynamic/admin --ref $BRANCH -f nop=true`
7+
- [ ] Output reviewed — no unexpected diffs
8+
- [ ] Known safe-settings bugs not triggered:
9+
- `bypass_pull_request_allowances` not added to any suborg file
10+
- `contexts:` uses `[]`, not a placeholder string
11+
- No subdirectory added to `.github/suborgs/`

.github/workflows/pr-dry-run.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Dry-run gate
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
dry-run:
12+
name: Safe-settings dry-run
13+
runs-on: ubuntu-24.04
14+
timeout-minutes: 30
15+
# Do not run on fork PRs — secrets are not available there
16+
if: github.event.pull_request.head.repo.full_name == github.repository
17+
env:
18+
SAFE_SETTINGS_VERSION: 2.1.17
19+
SAFE_SETTINGS_CODE_DIR: ${{ github.workspace }}/.safe-settings-code
20+
21+
steps:
22+
- name: Checkout PR branch
23+
uses: actions/checkout@v4
24+
with:
25+
ref: ${{ github.event.pull_request.head.sha }}
26+
27+
- name: Checkout safe-settings app
28+
uses: actions/checkout@v4
29+
with:
30+
repository: github/safe-settings
31+
ref: ${{ env.SAFE_SETTINGS_VERSION }}
32+
path: ${{ env.SAFE_SETTINGS_CODE_DIR }}
33+
34+
- name: Setup Node.js
35+
uses: actions/setup-node@v4
36+
with:
37+
node-version: "20"
38+
cache: npm
39+
cache-dependency-path: ${{ env.SAFE_SETTINGS_CODE_DIR }}/package-lock.json
40+
41+
- name: Install dependencies
42+
run: npm ci
43+
working-directory: ${{ env.SAFE_SETTINGS_CODE_DIR }}
44+
45+
- name: Run dry-run (NOP)
46+
run: npm run full-sync 2>&1 | tee /tmp/dry-run.log
47+
working-directory: ${{ env.SAFE_SETTINGS_CODE_DIR }}
48+
env:
49+
GH_ORG: ${{ vars.SAFE_SETTINGS_GH_ORG }}
50+
APP_ID: ${{ vars.SAFE_SETTINGS_APP_ID }}
51+
PRIVATE_KEY: ${{ secrets.SAFE_SETTINGS_PRIVATE_KEY }}
52+
GITHUB_CLIENT_ID: ${{ vars.SAFE_SETTINGS_GITHUB_CLIENT_ID }}
53+
GITHUB_CLIENT_SECRET: ${{ secrets.SAFE_SETTINGS_GITHUB_CLIENT_SECRET }}
54+
WEBHOOK_SECRET: ${{ secrets.WEBHOOK_SECRET }}
55+
ADMIN_REPO: admin
56+
DEPLOYMENT_CONFIG_FILE: ${{ github.workspace }}/deployment-settings.yml
57+
FULL_SYNC_NOP: "true"
58+
LOG_LEVEL: debug
59+
60+
# Runs even if the previous step crashed, so changes are always surfaced.
61+
# continue-on-error: finding diffs is informational, not a merge blocker —
62+
# a human must review but the PR is not blocked.
63+
- name: Report config changes
64+
if: always()
65+
continue-on-error: true
66+
run: |
67+
if grep -q "There are changes for branch" /tmp/dry-run.log; then
68+
echo "::warning::Config changes detected — human review required before merging"
69+
grep -A 2 "There are changes for branch" /tmp/dry-run.log
70+
exit 1
71+
fi

.github/workflows/safe-settings-sync.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ on:
2020
jobs:
2121
sync:
2222
name: Sync org settings${{ github.event.inputs.nop == 'true' && ' (dry-run)' || '' }}
23-
runs-on: ubuntu-latest
23+
runs-on: ubuntu-24.04
24+
timeout-minutes: 30
25+
permissions:
26+
contents: read
2427
env:
2528
SAFE_SETTINGS_VERSION: 2.1.17
2629
SAFE_SETTINGS_CODE_DIR: ${{ github.workspace }}/.safe-settings-code
@@ -43,7 +46,7 @@ jobs:
4346
cache-dependency-path: ${{ env.SAFE_SETTINGS_CODE_DIR }}/package-lock.json
4447

4548
- name: Install dependencies
46-
run: npm install
49+
run: npm ci
4750
working-directory: ${{ env.SAFE_SETTINGS_CODE_DIR }}
4851

4952
- name: Run full sync

CLAUDE.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ Only declare what **changes** at each level — everything else is inherited via
6868

6969
Controls the safe-settings **process** (not individual repos):
7070

71-
- `restrictedRepos.exclude` — repos safe-settings will never touch (currently: `admin`, `.github`)
71+
- `restrictedRepos.exclude` — repos safe-settings will never touch (currently: `.github` only —
72+
`admin` is managed like any other repo)
7273
- `configvalidators` — validate a single setting value (e.g. block admin collaborator permission)
7374
- `overridevalidators` — validate when a suborg/repo overrides an org setting (e.g. block lowering
7475
`required_approving_review_count` below org baseline)
@@ -89,10 +90,10 @@ These are **already worked around** in this repo — do not undo them:
8990
(concatenates, not replaces). If set in both `settings.yml` and a suborg file, `nbrieussel` ends
9091
up listed twice and the API rejects it. Set bypass **only** in `settings.yml`.
9192

92-
4. **probot v14 full-sync break**fixed in 2.1.19+ via
93-
[PR #949](https://github.com/github/safe-settings/pull/949). The version is currently pinned to
94-
`2.1.17` in `.github/workflows/safe-settings-sync.yml` (`SAFE_SETTINGS_VERSION`). Upgrading to
95-
`2.1.19` is safe; always do a dry-run first.
93+
4. **probot v14 full-sync break**PR #949 claimed to fix this but 2.1.19 still crashes with
94+
`TypeError: Cannot read properties of null (reading 'info') at performFullSync`. The octokit
95+
`.rest.*` calls were fixed but `createProbot()` still initializes with a null logger. **Stay on
96+
`2.1.17`** until a release actually boots cleanly in NOP mode.
9697

9798
## Open hygiene issues (tracked in this repo's GitHub Issues)
9899

deployment-settings.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@
99
# Add any repo that manages its own settings independently.
1010
restrictedRepos:
1111
exclude:
12-
- admin # the settings repo itself
1312
- .github # org-level .github repo
14-
# safe-settings repo deleted — app runs from github/safe-settings via GitHub Actions
15-
# gitops and infrastructure are now managed — remove to re-exclude
1613

1714
# configvalidators: validate a setting value in isolation.
1815
# The script receives `baseconfig` (the setting being applied) and must return true/false.

0 commit comments

Comments
 (0)