-
Notifications
You must be signed in to change notification settings - Fork 354
ci: add GitHub workflows for documentation validation and Mintlify checks #2047
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
viral-sangani
commented
Sep 30, 2025
- Broken Links Fixed (92 total)
- Script Improvements
- Added CICD to check valid docs
📚 Documentation Validation ResultsCheck Status
This check was performed by the Documentation Validation workflow. |
📚 Documentation Validation ResultsCheck Status
Broken Links DetailsThis check was performed by the Documentation Validation workflow. |
📚 Documentation Validation ResultsCheck Status
Broken Links DetailsThis check was performed by the Documentation Validation workflow. |
- Add set +e/set -e wrapper around mint broken-links command - Capture exit code to prevent script from exiting early - Allow script to continue and report all validation errors - Fixes workflow failure when broken links are detected
- Fix stablecoin links in build-with-defi.mdx (use absolute paths) - Fix plumo verification link to use relative path - Replace broken /glossary#epoch-rewards links with actual epoch rewards pages - Replace broken /glossary#slashing links with actual penalties pages - All 7 broken links across 6 files now resolved Verified with: mint broken-links
| echo "3️⃣ Checking for missing MDX files..." | ||
| if [ "$JQ_AVAILABLE" = true ]; then | ||
| MISSING_FILES=0 | ||
|
|
||
| # Extract all page references and check if files exist | ||
| jq -r '.. | .pages? // empty | .[] | select(type == "string")' docs.json 2>/dev/null | while read -r page; do | ||
| file_path="${page}.mdx" | ||
|
|
||
| if [ ! -f "$file_path" ] && [ ! -f "${page}.md" ]; then | ||
| echo -e "${YELLOW}⚠️ Missing file: $file_path${NC}" | ||
| MISSING_FILES=$((MISSING_FILES + 1)) | ||
| fi | ||
| done | ||
|
|
||
| if [ $MISSING_FILES -eq 0 ]; then | ||
| echo -e "${GREEN}✅ All referenced MDX files exist${NC}" | ||
| else | ||
| echo -e "${YELLOW}⚠️ Some referenced files are missing${NC}" | ||
| fi | ||
| else | ||
| echo -e "${YELLOW}⚠️ Skipping MDX file check (jq not available)${NC}" | ||
| fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shellcheck errors for this.
In scripts/validate-docs.sh line 102:
MISSING_FILES=$((MISSING_FILES + 1))
^-----------^ SC2030 (info): Modification of MISSING_FILES is local (to subshell caused by pipeline).
In scripts/validate-docs.sh line 106:
if [ $MISSING_FILES -eq 0 ]; then
^------------^ SC2031 (info): MISSING_FILES was modified in a subshell. That change might be lost.
Basically piping input to the loop results in all variable changes inside the loop being local to the loop, so MISSING_FILES will always be 0 when checked after the loop.
You can fix this by using process substitution to feed input to the loop:
...
done < <(jq -r '.. | .pages? // empty | .[] | select(type == "string")' docs.json 2>/dev/null
| - name: Run Mintlify validation | ||
| run: | | ||
| echo "Running Mintlify validation checks..." | ||
| mint install || true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to document why you are allowing errors in mint install