Skip to content
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,72 @@ jobs:
run: yarn install --frozen-lockfile
- name: Build the Docusaurus site
run: yarn build
# --- NEW: Disallowed character checks for Pantheon ---
# 1) Fail if any file path in the build output contains disallowed characters
- name: Check build artifact paths for disallowed characters
env:
BUILD_DIR: build
shell: bash
run: |
if [ ! -d "$BUILD_DIR" ]; then
echo "No $BUILD_DIR directory found; skipping path check."
exit 0
fi
# Disallowed chars: " : < > | * ?
OFFENDERS="$(find "$BUILD_DIR" -type f | grep -E '[\":<>|*?]')" || true
if [ -n "$OFFENDERS" ]; then
echo "❌ Disallowed characters found in build artifact paths:"
echo "$OFFENDERS"
# Annotate each offending path; show relative path from repo root
while IFS= read -r p; do
# Normalize to repo-relative path
rel="${p#$(pwd)/}"
[ "$rel" = "$p" ] && rel="$p"
echo "::error file=${rel}::Disallowed character found in build artifact path (Pantheon rejects paths containing any of: \" : < > | * ?)"
done <<< "$OFFENDERS"
exit 1
fi
echo "✅ No disallowed characters found in build artifact paths."
# 2) Fail if any Markdown/MDX link target contains disallowed characters (excluding external links)
- name: Check Markdown/MDX links for disallowed characters
shell: bash
run: |
FILES="$(git ls-files '*.md' '*.mdx' 2>/dev/null || true)"
if [ -z "$FILES" ]; then
echo "No Markdown/MDX files found; skipping link check."
exit 0
fi
BAD_LINKS=$(
awk '
{
line=$0
while (match(line, /\]\(([^)]+)\)/, m)) {
url=m[1]
# skip external schemes
if (url ~ /^(https?:|mailto:|tel:)/) { line=substr(line, RSTART+RLENGTH); continue }
# drop query + fragment
sub(/\?.*$/, "", url)
sub(/#.*/, "", url)
# flag if contains disallowed characters: " : < > | * ?
if (url ~ /[" :<>|*?]/) {
printf("%s\t%d\t%s\n", FILENAME, FNR, m[0])
}
line=substr(line, RSTART+RLENGTH)
}
}
' $FILES
)
if [ -n "$BAD_LINKS" ]; then
echo "❌ Disallowed characters found in Markdown/MDX link targets:"
echo "$BAD_LINKS"
# Emit GitHub annotations for each finding
while IFS=$'\t' read -r file line match; do
[ -z "$file" ] && continue
echo "::error file=${file},line=${line}::Disallowed character in Markdown link target: ${match} (Not allowed: \" : < > | * ?)"
done <<< "$BAD_LINKS"
exit 1
fi
echo "✅ No disallowed characters found in Markdown/MDX link targets."
spellcheck:
runs-on: ubuntu-latest
steps:
Expand Down
3 changes: 2 additions & 1 deletion cid-redirects.json
Original file line number Diff line number Diff line change
Expand Up @@ -4521,5 +4521,6 @@
"/docs/cse/signals": "/docs/cse/records-signals-entities-insights",
"/docs/query/query-operators/aggregation-functions": "/docs/search/search-query-language/group-aggregate-operators",
"/Search/Search-Query-Language/Parse-Operators": "/docs/search/search-query-language/parse-operators",
"/docs/get-started/training-certification-faq-new": "/docs/get-started/training-certification-faq"
"/docs/get-started/training-certification-faq-new": "/docs/get-started/training-certification-faq",
"/01Start-Here/Quick-Start-Tutorials/Using-Sumo-Logic-Tutorial/Lab-1:Viewing-Data": "/docs/get-started/training-certification-faq"
}
Loading