@@ -16,7 +16,9 @@ Labels are defined in `core/github-labels-config.ts` and synced using `tools/git
1616## Prerequisites
1717
1818- Node.js 18+
19- - GitHub CLI (` gh ` ) installed and authenticated
19+ - Authentication via one of:
20+ - GitHub CLI (` gh ` ) installed and authenticated (` gh auth login ` )
21+ - ` GITHUB_TOKEN ` environment variable with repo scope
2022- For sync operations: write access to target repositories
2123
2224## Label Categories
@@ -55,6 +57,26 @@ Labels that identify which part of the system is affected:
5557| smartem-devtools: claude | Pink (light) | Claude Code configuration |
5658| smartem-devtools: e2e-test | Pink (lightest) | E2E testing infrastructure |
5759
60+ ### Per-Repository Configuration
61+
62+ Not all repos need all labels. The config defines which label sets each repo receives:
63+
64+ | Mode | Labels Applied | Use Case |
65+ | ------| ----------------| ----------|
66+ | ` all ` | Types of work + system components | Index repo (smartem-devtools) |
67+ | ` types-only ` | Types of work only | Individual repos |
68+
69+ Current assignments in ` core/github-labels-config.ts ` :
70+
71+ | Repository | Mode |
72+ | ------------| ------|
73+ | smartem-devtools | ` all ` |
74+ | smartem-decisions | ` types-only ` |
75+ | smartem-frontend | ` types-only ` |
76+ | fandanGO-cryoem-dls | ` types-only ` |
77+
78+ System component labels are only relevant in the devtools index repo where cross-repo issues are tracked.
79+
5880## Usage
5981
6082### Check Label Conformity
@@ -139,6 +161,38 @@ To add, remove, or modify labels:
139161
140162The CI/CD workflow will verify conformity on push.
141163
164+ ## Authentication Backends
165+
166+ The sync script supports two authentication backends with automatic fallback:
167+
168+ ### Primary: GitHub CLI
169+
170+ The preferred method uses ` gh ` CLI for shell-based operations:
171+
172+ ``` bash
173+ gh auth login
174+ gh auth status # verify authentication
175+ ```
176+
177+ ### Fallback: GitHub REST API
178+
179+ If ` gh ` CLI is unavailable or not authenticated, the script falls back to the GitHub REST API using a personal access token:
180+
181+ ``` bash
182+ export GITHUB_TOKEN=ghp_xxxxxxxxxxxx
183+ ```
184+
185+ Generate a token at https://github.com/settings/tokens with ` repo ` scope.
186+
187+ The script automatically selects the best available backend and displays which one is in use:
188+
189+ ```
190+ GitHub Labels Sync
191+ Mode: check
192+ Repos: smartem-devtools, smartem-decisions, smartem-frontend, fandanGO-cryoem-dls
193+ Backend: gh CLI
194+ ```
195+
142196## Troubleshooting
143197
144198### Authentication Errors
@@ -150,6 +204,8 @@ gh auth status
150204gh auth login # if not authenticated
151205```
152206
207+ Or set ` GITHUB_TOKEN ` environment variable as fallback.
208+
153209### Permission Denied
154210
155211For sync operations, you need write access to all target repositories. The CI/CD workflow uses a PAT stored as ` LABEL_SYNC_TOKEN ` secret.
0 commit comments