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: CHANGELOG.md
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,11 @@
3
3
> Changes in **0.1.4 and after** — every release from `0.1.4` through `0.2.1`.
4
4
> (`chore: regenerate docs` and merge commits are omitted.)
5
5
6
+
## Unreleased
7
+
8
+
### Features
9
+
-**Private remote sources** — sync from private Git repositories by adding `'token' => '${ENV_VAR}'` (and optionally `'username'`) to a `docsmith.sources.php` entry. Tokens resolve from the environment at sync time; without an explicit token, `DOCSMITH_TOKEN` is used for any host and `GITHUB_TOKEN` / `GH_TOKEN` only for github.com hosts (never sent to third-party hosts). Requires [mrpunyapal/git-reader](https://github.com/MrPunyapal/git-reader) 0.2.0.
'token' => '${ACME_PAT}', // read from the ACME_PAT environment variable
629
+
'username' => 'doc-bot', // optional; defaults to x-access-token
630
+
],
631
+
];
632
+
```
633
+
634
+
- **`'token' => '${ENV_VAR_NAME}'`** is the recommended form: DocSmith reads the variable from the environment at sync time and fails with a clear message if it is unset. A literal token string also works, but hardcoding secrets in a committed file is discouraged.
635
+
- **Automatic fallbacks** — if no `token` key is present, DocSmith uses `DOCSMITH_TOKEN` for any HTTPS host, and `GITHUB_TOKEN` / `GH_TOKEN` only for repositories on github.com. GitHub tokens are never sent to third-party hosts, and fallback tokens are never attached to plain-HTTP URLs.
636
+
- **Never commit tokens.** Keep them in your shell profile or `.env`, and let CI inject them via repository secrets.
637
+
616
638
617
639
## Programmatic use
618
640
@@ -1175,6 +1197,8 @@ jobs:
1175
1197
# Syncs remote sources (incremental when docsmith.sources.lock.json
1176
1198
# matches) and builds in one step.
1177
1199
- run: php bin/docsmith build --sync
1200
+
env:
1201
+
ACME_PAT: ${{ secrets.ACME_PAT }} # only needed for private sources
<li><strong><code>'token' => '${ENV_VAR_NAME}'</code></strong> is the recommended form: DocSmith reads the variable from the environment at sync time and fails with a clear message if it is unset. A literal token string also works, but hardcoding secrets in a committed file is discouraged.</li>
156
+
<li><strong>Automatic fallbacks</strong> — if no <code>token</code> key is present, DocSmith uses <code>DOCSMITH_TOKEN</code> for any HTTPS host, and <code>GITHUB_TOKEN</code> / <code>GH_TOKEN</code> only for repositories on github.com. GitHub tokens are never sent to third-party hosts, and fallback tokens are never attached to plain-HTTP URLs.</li>
157
+
<li><strong>Never commit tokens.</strong> Keep them in your shell profile or <code>.env</code>, and let CI inject them via repository secrets.</li>
0 commit comments