Skip to content

Commit e0961f3

Browse files
committed
chore(release): Allow docs check warnings for release commits
Let release automation run pre-commit docs validation in warn-only mode. This keeps release version commits moving when consumer docs references are being finalized separately, while preserving strict docs checks for normal commits.
1 parent 112d05d commit e0961f3

2 files changed

Lines changed: 13 additions & 8 deletions

File tree

.githooks/pre-commit

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,16 @@ if [ $? -ne 0 ]; then
2727
exit 1
2828
fi
2929

30-
echo "Validating CLI command references in consumer docs..."
31-
npm run docs:check
32-
if [ $? -ne 0 ]; then
33-
echo "${RED}Docs command validation failed. Aborting commit.${NC}"
34-
exit 1
30+
if [ "${XCODEBUILDMCP_DOCS_CHECK_WARN_ONLY:-}" = "1" ]; then
31+
echo "Validating CLI command references in consumer docs (warnings only)..."
32+
node scripts/check-docs-cli-commands.js --warn-only
33+
else
34+
echo "Validating CLI command references in consumer docs..."
35+
npm run docs:check
36+
if [ $? -ne 0 ]; then
37+
echo "${RED}Docs command validation failed. Aborting commit.${NC}"
38+
exit 1
39+
fi
3540
fi
3641

3742
echo "Pre-commit checks passed."

scripts/release.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ if [[ "$SKIP_VERSION_UPDATE" == "false" ]]; then
445445
else
446446
run git add package.json package-lock.json CHANGELOG.md
447447
fi
448-
run git commit -m "Release v$VERSION"
448+
run env XCODEBUILDMCP_DOCS_CHECK_WARN_ONLY=1 git commit -m "Release v$VERSION"
449449
else
450450
echo "⏭️ Skipping version update (already done)"
451451
# Ensure server.json still matches the desired version (in case of a partial previous run)
@@ -455,14 +455,14 @@ else
455455
echo "📝 Aligning server.json to $VERSION..."
456456
run node -e "const fs=require('fs');const f='server.json';const j=JSON.parse(fs.readFileSync(f,'utf8'));j.version='${VERSION}';if(Array.isArray(j.packages)){j.packages=j.packages.map(p=>({...p,version:'${VERSION}'}));}fs.writeFileSync(f,JSON.stringify(j,null,2)+'\n');"
457457
run git add server.json
458-
run git commit -m "Align server.json for v$VERSION"
458+
run env XCODEBUILDMCP_DOCS_CHECK_WARN_ONLY=1 git commit -m "Align server.json for v$VERSION"
459459
fi
460460
fi
461461

462462
if $CHANGELOG_RENAMED_ON_DISK; then
463463
echo "📝 Committing changelog release heading update..."
464464
run git add CHANGELOG.md
465-
run git commit -m "Finalize changelog for v$VERSION"
465+
run env XCODEBUILDMCP_DOCS_CHECK_WARN_ONLY=1 git commit -m "Finalize changelog for v$VERSION"
466466
fi
467467
fi
468468

0 commit comments

Comments
 (0)