Skip to content

Commit f3fc568

Browse files
authored
Merge pull request #85952 from openshift-cherrypick-robot/cherry-pick-85878-to-enterprise-4.16
[enterprise-4.16] Allowing includes to use content from openshift-kni repo as well as openshift repo
2 parents db454b3 + dda1513 commit f3fc568

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

build_for_portal.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -623,10 +623,19 @@ def scrub_file(info, book_src_dir, src_file, tag=None, cwd=None):
623623
# data that it finds.
624624
# modified 20/Aug/2024 to process https links which are preceded
625625
# by an added directory (happens with hugeBook)
626+
# Modified 05/Dec/2024 to allow for https links from openshift-kni repo.
626627

628+
# Check for both allowed URL patterns
627629
https_pos = base_src_file.find("https://raw.githubusercontent.com/openshift/")
628-
if https_pos >=0:
629-
base_src_file = base_src_file[https_pos:]
630+
https_kni_pos = base_src_file.find("https://raw.githubusercontent.com/openshift-kni/")
631+
632+
if https_pos >= 0 or https_kni_pos >= 0:
633+
# Ensure we start from the correct URL (either github or openshift-kni)
634+
if https_kni_pos >= 0:
635+
base_src_file = base_src_file[https_kni_pos:]
636+
else:
637+
base_src_file = base_src_file[https_pos:]
638+
630639
try:
631640
response = requests.get(base_src_file)
632641
if response:

contributing_to_docs/doc_guidelines.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,7 @@ host site.
730730
[IMPORTANT]
731731
====
732732
You are restricted to only embed files from GitHub repositories managed by the
733-
`openshift` GitHub user. You must also prefix your external file URI with `https`.
733+
`openshift` or `openshift-kni` GitHub user. You must also prefix your external file URI with `https`.
734734
URIs beginning with `http` are forbidden for security reasons and will fail the
735735
documentation build.
736736
====

0 commit comments

Comments
 (0)