pnpm/.github/workflows/docs.yml
Zoltan Kochan 1d82359a81
ci: preview only the documentation lines main holds (#18367)
## Summary

pnpm.io's docs preview imported every documentation line, so this repo's
docs workflows fetched `pnpm11/docs` from `release/11` before every
preview. pnpm/pnpm.io#998 lets the importer take a list of lines, and
lines left out keep the copies committed in pnpm/pnpm.io.

- `docs.yml` runs `--preview 12.x pnpr`, no longer fetches `release/11`,
and pins the pnpm.io revision that accepts a line list.
- The manual "publish all docs from main" sync in `sync-docs.yml`
imports 12.x and pnpr only. Before, it also published `release/11`'s
current 11.x docs, including unreleased changes. The 11.x docs on the
website now change only when a v11 release syncs them.
- `DOCUMENTATION.md` drops the `release/11` fetch from the local preview
steps.

`release/11` gets the matching change in a separate PR against that
branch.

## Checklist

- [x] Updated the documentation if needed.

---
Written by an agent (Claude Code, claude-opus-5-5).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- codesmith:footer -->
---
<a
href="https://dashboardbackend.blacksmith.sh/track/run-proof?expires=1797974148&installation_model_id=426870&pr_number=18367&ref=codesmith_pr_footer&repository=pnpm%2Fpnpm&return_to=https%3A%2F%2Fgithub.com%2Fpnpm%2Fpnpm%2Fpull%2F18367&variant=see_it_in_action&signature=1be1d2edd667bcd8adba0c472dd2c125acbfd552c9031789986604b521c10f90"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://pr-comments-assets.blacksmith.sh/codesmith/proof-see-it-in-action-v2-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://pr-comments-assets.blacksmith.sh/codesmith/proof-see-it-in-action-v2-light.svg"><img
alt="See it in action"
src="https://pr-comments-assets.blacksmith.sh/codesmith/proof-see-it-in-action-v2-dark-3x.png"
width="132" height="28"></picture></a>
<sup><a
href="https://app.blacksmith.sh/pnpm/codesmith/pnpm/pr/18367?autoLogin=true&ref=codesmith_pr_footer">Open
in [code]smith</a> · Need help on this PR? Tag
<code>@codesmith-bot</code> with what you need.</sup>

<!-- codesmith:autofix:disabled -->
<!-- /codesmith:footer -->

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **Documentation**
  * Documentation previews now include the 12.x and pnpr lines.
* Preview syncs replace the website’s generated copies for the listed
documentation lines; other lines continue to use the copies committed to
the website.
* Updated preview-sync guidance to use the website’s current main branch
instead of fetching and restoring release/11 documentation.
* Main-branch documentation syncs use the same preview targets; non-main
sync behavior remains unchanged.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 00:42:32 +01:00

56 lines
1.7 KiB
YAML

name: Documentation
on:
pull_request:
paths:
- 'pnpm/docs/**'
- 'pnpr/docs/**'
- 'DOCUMENTATION.md'
- '.github/workflows/docs.yml'
- '.github/workflows/sync-docs.yml'
- '.github/scripts/prepare-docs-sync*.mjs'
- '.github/scripts/copy-docs-artifact*.mjs'
push:
branches: [main]
paths:
- 'pnpm/docs/**'
- 'pnpr/docs/**'
- 'DOCUMENTATION.md'
- '.github/workflows/docs.yml'
- '.github/workflows/sync-docs.yml'
- '.github/scripts/prepare-docs-sync*.mjs'
- '.github/scripts/copy-docs-artifact*.mjs'
permissions:
contents: read
concurrency:
group: docs-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: pnpm/pnpm.io
ref: 29f86c5f4170e6fc0477c5ef90b4d8160f8902aa # pnpm.io documentation importer
path: website
persist-credentials: false
- uses: pnpm/setup@731dfb6463bbd11c11fd0ee11fe00ed0e36d48a1 # v3.2.0
with:
runtime: node@22
install: false
- name: Test release source validation
run: node --test .github/scripts/prepare-docs-sync.test.mjs .github/scripts/copy-docs-artifact.test.mjs
- name: Build the website with this PR's documentation
working-directory: website
run: |
pnpm install --frozen-lockfile
node scripts/sync-docs.mjs .. --preview 12.x pnpr
pnpm build
pnpm check-urls