Draft
Conversation
Co-authored-by: displague <317653+displague@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add hydrate-localize action for Docusaurus plugin
Add hydrate-localize composite GitHub Action
Feb 20, 2026
displague
reviewed
Feb 20, 2026
| async requestHandler({ request, page, enqueueLinks }) { | ||
| const requestHost = 'https://global.localizecdn.com'; | ||
| const requestMethod = 'POST'; | ||
| if (request.loadedUrl.indexOf('api-catalog') >= 0) { |
Member
There was a problem hiding this comment.
@copilot api-catalog would be a variable that takes multiple path prefixes to apply this logic to
Contributor
Author
There was a problem hiding this comment.
Done in feb4090. Added a skip_path_prefixes input (comma-separated, defaults to api-catalog) to action.yml. In index.js it's parsed into an array and checked with pathname.startsWith(/${prefix}) — leading slashes in user-supplied prefixes are stripped to avoid double-slash matches.
Co-authored-by: displague <317653+displague@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a reusable GitHub composite action to crawl a target docs environment with headless Chromium, triggering Localize phrase detection. Intended to be pointed at a lower environment (QA/UAT/preprod) to prevent local browser extension artifacts (e.g., translation plugins) from polluting Localize's phrase corpus on production.
Action inputs
target_base_url(required): base URL of the environment to crawlsitemap_path(optional, default:sitemap.xml): sitemap path relative to base URLskip_path_prefixes(optional, default:api-catalog): comma-separated list of URL path prefixes for which Localize is disabled and the crawler should not wait for a Localize requestExample usage
Key implementation notes
requestHandlerbug from the original prototype — the second definition silently overwrote the first, dropping thepage.waitForRequestlogic entirelypathname + search + hashfrom the sitemap URL rather than a hardcodedhttps://docs.equinix.comstring replace, making the action origin-agnosticnew URL(req.url()).origin ===instead ofstartsWith()to prevent subdomain bypass (CodeQLjs/incomplete-url-substring-sanitization)pathname.startsWith(/${prefix})— supporting multiple path subtrees where Localize is inactiveplaywrightpinned to^1.55.1(patched SSL certificate verification vulnerability present in<1.55.1)"type": "module"set inpackage.jsonfor ESMimportsyntax;package-lock.jsoncommitted for reproduciblenpm ciKnown limitation
crawlee's transitive dependency onminimatch <10.2.1(GHSA-3ppc-4f35-3m26, ReDoS) has no fix available in the current crawlee release line.💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.