Title: Move the docs-preview workflow scripts out of the YAML into .github/scripts by maxisbey · Pull Request #3446 · modelcontextprotocol/python-sdk · GitHub
Open Graph Title: Move the docs-preview workflow scripts out of the YAML into .github/scripts by maxisbey · Pull Request #3446 · modelcontextprotocol/python-sdk
X Title: Move the docs-preview workflow scripts out of the YAML into .github/scripts by maxisbey · Pull Request #3446 · modelcontextprotocol/python-sdk
Description: Pure refactor: no behaviour change to the docs preview flow. Motivation and Context docs-preview.yml carried two ~45-line blocks of inline JavaScript in actions/github-script steps (authorize and comment). Inline scripts can't be linted, unit-tested, or reviewed as code, and every edit to them is a YAML diff. require-linked-issue.yml already does this the better way: the logic lives in .github/scripts/pr_intake_gate.js with scenario tests beside it, and the workflow step is a two-line require + call. This moves the docs-preview logic to .github/scripts/docs_preview.js (authorize and comment exports) in the same shape, verbatim apart from hoisting the marker/bot-login constants. That also sets up the checkout-v7 follow-up (#3445) to be a few lines in the module plus a test, rather than another YAML-embedded edit. Workflow changes that come with the move: Both authorize and comment now start with a sparse checkout of .github/scripts (persist-credentials: false) so the module is on disk for github-script's require. Under pull_request_target and issue_comment a default checkout resolves to the default branch, so this is trusted code, never the PR's; the header notes it. comment gains contents: read for that checkout. shared.yml's checks job runs node --test '.github/scripts/*.test.js' instead of naming the one gate test file, and the setup-node comment no longer names a github-script major (v9 is still node24). The Cloudflare cleanup shell block in docs-preview-cleanup.yml stays inline: moving it would mean adding a checkout to a job that holds the Cloudflare token, for little gain. How Has This Been Tested? New .github/scripts/docs_preview.test.js (14 scenarios) alongside the existing gate tests; node --test '.github/scripts/*.test.js' passes all 43 locally. Ran the pinned actions/github-script v9.0.0 bundle locally against the new two-line authorize stub in a scratch workspace containing only .github/scripts/: the module resolves via the action's wrapped require, authorize runs, and the injected client issues the collaborators-permission request (stopping at the expected 401 with a dummy token). pre-commit run --files on the four touched files. pull_request_target/issue_comment read the workflow from main, so CI on this PR does not exercise the new steps; after merge, /preview-docs on any open docs PR (or the next admin push to one) is the live check. Breaking Changes None. Types of changes Bug fix (non-breaking change which fixes an issue) New feature (non-breaking change which adds functionality) Breaking change (fix or feature that would cause existing functionality to change) Documentation update Refactor of CI tooling only. Checklist I have read the MCP Documentation My code follows the repository's style guidelines New and existing tests pass locally I have added appropriate error handling I have added or updated documentation as needed AI Disclaimer
Open Graph Description: Pure refactor: no behaviour change to the docs preview flow. Motivation and Context docs-preview.yml carried two ~45-line blocks of inline JavaScript in actions/github-script steps (authorize and c...
X Description: Pure refactor: no behaviour change to the docs preview flow. Motivation and Context docs-preview.yml carried two ~45-line blocks of inline JavaScript in actions/github-script steps (authorize and c...
Opengraph URL: https://github.com/modelcontextprotocol/python-sdk/pull/3446
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:382ae4bd-1b42-9970-197a-52c7a4af96b9 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | B1FC:3B6A24:1569EDB:1D797B4:6B057B93 |
| html-safe-nonce | 92020f5b5c318be9e95b96f997afce177205f05020688f3ceb04637cb7adb19b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMUZDOjNCNkEyNDoxNTY5RURCOjFENzk3QjQ6NkIwNTdCOTMiLCJ2aXNpdG9yX2lkIjoiNDE5MTg5MDUwOTM0ODA0MzY2NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 08e091e81bc2a620b95f602cd872c54dc700a0db482d77641f30221ef133c51c |
| hovercard-subject-tag | pull_request:4446091272 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/modelcontextprotocol/python-sdk/pull/3446/files |
| twitter:image | https://avatars.githubusercontent.com/u/224885523?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/224885523?s=400&v=4 |
| og:image:alt | Pure refactor: no behaviour change to the docs preview flow. Motivation and Context docs-preview.yml carried two ~45-line blocks of inline JavaScript in actions/github-script steps (authorize and c... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 507b2d62524c0f595c35a2a2ee8a6ec54b119f245b3c59eaa070013b70ed1ada |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/modelcontextprotocol/python-sdk git https://github.com/modelcontextprotocol/python-sdk.git |
| octolytics-dimension-user_id | 182288589 |
| octolytics-dimension-user_login | modelcontextprotocol |
| octolytics-dimension-repository_id | 862584018 |
| octolytics-dimension-repository_nwo | modelcontextprotocol/python-sdk |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 862584018 |
| octolytics-dimension-repository_network_root_nwo | modelcontextprotocol/python-sdk |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | e7a883ae3b439b8952652eaa7803e2587f30e339 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | no-cache |
Viewport: width=device-width