docs-v2/.github
Jason Stirnaman 0fbf9e5e9b
fix(ci): complete PR preview path offset and fork PR handling (#6667)
* fix(ci): add path offset for PR preview subdirectory baseURL

When PR preview builds use a subdirectory baseURL like
/docs-v2/pr-preview/pr-XXXX/, shortcodes that parse .RelPermalink
to detect product context fail because the path has extra segments.

This fix:
- Adds config/pr-preview/params.yml with prPreviewPathOffset: 3
- Updates workflow to use -e pr-preview environment
- Updates api-endpoint, influxdb/host, and children shortcodes to
  use the offset when indexing path segments
- Adds nil-safety with default fallback for placeholder_host

Normal builds are unaffected (offset defaults to 0).

* fix(ci): add path offset to product-name and sidebar for PR previews

Apply the same prPreviewPathOffset fix to product-name.html and
sidebar.html that was applied in the initial PR #6665.

These templates parse RelPermalink to detect product context, but when
baseURL includes a subdirectory path (e.g., /docs-v2/pr-preview/pr-XXXX/),
the path indices shift. This fix uses the configurable offset to skip
extra path segments in PR preview builds.

* fix(ci): skip PR preview for fork PRs and add notice comment

Fork PRs cannot deploy to gh-pages because GITHUB_TOKEN has read-only
access to the base repository. This is a GitHub security feature.

Changes:
- Add condition to skip preview job for fork PRs
- Add fork-notice job to post helpful comment explaining limitation
- Include local preview instructions for contributors
2025-12-22 15:30:26 -06:00
..
ISSUE_TEMPLATE Automate plugin documentation sync workflow between influxdb3_plugins and docs-v2 (#6329) 2025-10-20 17:18:34 -05:00
actions/setup-docs-env chore(ci): Add config for new link validation tool (docs-tooling/link-checker) 2025-08-16 22:14:27 -05:00
agents feat(influxdb): Version detector shortcode triggers a modal 2025-09-30 19:01:21 -05:00
instructions Ask AI group filters (#6529) 2025-11-18 16:43:02 -06:00
pull_request_template docs(enterprise): add v1.12.2 release notes 2025-09-12 16:54:45 -05:00
scripts refactor(ci): improve PR preview with products.yml and index page (#6656) 2025-12-19 12:12:20 -06:00
workflows fix(ci): complete PR preview path offset and fork PR handling (#6667) 2025-12-22 15:30:26 -06:00
INSTRUCTIONS.md Configure GitHub Copilot instructions and navigation system (#6628) 2025-12-15 12:43:34 -06:00
ISSUE_TEMPLATE.md updated note in issue template 2019-10-07 12:59:09 -06:00
PREVIEW_SETUP.md feat(ci): add PR preview system for GitHub Pages (#6636) 2025-12-18 13:44:14 -06:00
PULL_REQUEST_TEMPLATE.md chore(instructions): restructure contributing instructions for humans and assistants 2025-10-08 15:48:44 -05:00
SECURITY.md added license and issue template, moved security.md 2019-10-07 10:27:36 -06:00
copilot-instructions.md Configure GitHub Copilot instructions and navigation system (#6628) 2025-12-15 12:43:34 -06:00