@@ -330,18 +330,21 @@ runs:
330330 # Check which tools we'll need based on enabled validations
331331 NEEDS_PNPM="false"
332332 NEEDS_NODE="false"
333- # Note: Vale is now handled via GitHub Action, not manual installation
333+ NEEDS_VALE="false"
334334
335335 if [ "${{ env.lint_markdown }}" == "true" ] || [ "${{ env.check_format }}" == "true" ]; then
336336 NEEDS_PNPM="true"
337337 NEEDS_NODE="true"
338338 fi
339339
340+ if [ "${{ env.lint_vale }}" == "true" ]; then
341+ NEEDS_VALE="true"
342+ fi
343+
340344 # Output for workflow to use
341345 echo "needs_pnpm=$NEEDS_PNPM" >> $GITHUB_OUTPUT
342346 echo "needs_node=$NEEDS_NODE" >> $GITHUB_OUTPUT
343- # Vale is now handled by an action, no longer need this output
344- echo "needs_vale=false" >> $GITHUB_OUTPUT
347+ echo "needs_vale=$NEEDS_VALE" >> $GITHUB_OUTPUT
345348
346349# === PHASE 1D: CONTEXT EXTRACTION ===
347350# Centralized PR and branch information extraction
@@ -698,65 +701,101 @@ runs:
698701 echo "message=Link checking is enabled" >> $GITHUB_OUTPUT
699702 echo "::endgroup::"
700703
701- # Use the official Vale GitHub Action for style checking
704+ # Vale style checking - direct command execution for composite action compatibility
705+ # Note: We're using direct execution because composite actions have limitations
706+ # with using other actions within them
702707 -name :Run Vale style checks
703708id :lint-vale
704709if :env.lint_vale == 'true' && steps.file-detection.outputs.has_changes == 'true'
705- uses :errata-ai/vale-action@reviewdog
706- with :
707- files :${{ steps.file-detection.outputs.changed_files_csv }}
708- fail_on_error :false
709- reporter :github-check
710- token :${{ inputs.github-token }}
711- vale_flags :" --config=.github/docs/vale/.vale.ini"
712-
713- # Process Vale results for consistent output format
714- -name :Process Vale results
715- id :process-vale-results
716- if :env.lint_vale == 'true' && steps.file-detection.outputs.has_changes == 'true'
717710shell :bash
718711run :|
719- echo "::group::Vale results processing"
712+ echo "::group::Vale style checking"
713+
714+ # Notice about GitHub Action implementation
715+ echo "::notice::Vale would ideally use errata-ai/vale-action@reviewdog in a workflow context"
716+ echo "::notice::But for composite action compatibility, we're using direct execution"
720717
721718 # Get the files to check from the detection step
722719 CHANGED_FILES_JSON='${{ steps.file-detection.outputs.changed_files_json }}'
723720
724721 # Skip if no files to check
725722 if [ "$CHANGED_FILES_JSON" == "[]" ] || [ -z "$CHANGED_FILES_JSON" ]; then
726- echo "No fileswere checked with Vale"
723+ echo "No filesto check with Vale"
727724 echo "status=success" >> $GITHUB_OUTPUT
728725 echo "message=No files to check" >> $GITHUB_OUTPUT
729726 echo "::endgroup::"
730727 exit 0
731728 fi
732729
733- # Extract markdown filesthat were checked
734- FILES_COUNT =$(echo "$CHANGED_FILES_JSON" | jq -r '.[] | select(endswith(".md"))' |wc -l | tr-d ' ')
730+ # Extract markdown filesto check
731+ FILES_TO_CHECK =$(echo "$CHANGED_FILES_JSON" | jq -r '.[] | select(endswith(".md"))' | tr'\n' ' ')
735732
736- if [$FILES_COUNT -eq 0 ]; then
737- echo "No markdown fileswere checked "
733+ if [-z "$FILES_TO_CHECK" ]; then
734+ echo "No markdown filesto check "
738735 echo "status=success" >> $GITHUB_OUTPUT
739736 echo "message=No markdown files to check" >> $GITHUB_OUTPUT
740737 echo "::endgroup::"
741738 exit 0
742739 fi
743740
744- # Vale action doesn't provide a specific output we can use directly
745- # So we'll record that it ran successfully and was integrated
741+ # For GitHub Actions environment, we should use the vale binary
742+ # which is installed in the parent workflow
743+ if ! command -v vale &> /dev/null; then
744+ echo "Vale command not found - expecting it to be in PATH"
745+ echo "status=skipped" >> $GITHUB_OUTPUT
746+ echo "message=Vale binary not available" >> $GITHUB_OUTPUT
747+ echo "::endgroup::"
748+ exit 0
749+ fi
746750
747- # Determine status based on Vale action
748- if [ "${{ steps.lint-vale.outcome }}" == "success" ]; then
749- echo "Vale check completed successfully"
750- echo "status=success" >> $GITHUB_OUTPUT
751- echo "message=Style checking completed on $FILES_COUNT files" >> $GITHUB_OUTPUT
752- elif [ "${{ steps.lint-vale.outcome }}" == "failure" ]; then
753- echo "Vale found style issues"
754- echo "status=warning" >> $GITHUB_OUTPUT
755- echo "message=Style issues found in documentation" >> $GITHUB_OUTPUT
751+ # Count files
752+ FILE_COUNT=$(echo "$FILES_TO_CHECK" | wc -w | tr -d ' ')
753+ echo "Checking $FILE_COUNT markdown files with Vale"
754+
755+ # Create temporary directory for results
756+ TEMP_DIR=$(mktemp -d)
757+ trap 'rm -rf "$TEMP_DIR"' EXIT
758+
759+ # Run Vale with JSON output for processing
760+ echo "Running Vale with config .github/docs/vale/.vale.ini"
761+ vale --no-exit --output=JSON --config=.github/docs/vale/.vale.ini $FILES_TO_CHECK > "$TEMP_DIR/vale_results.json" 2>/dev/null ||true
762+
763+ # Process results from JSON output
764+ if [ -f "$TEMP_DIR/vale_results.json" ]; then
765+ # Make sure the JSON output is valid
766+ if jq empty "$TEMP_DIR/vale_results.json" 2>/dev/null; then
767+ VALE_OUTPUT=$(cat "$TEMP_DIR/vale_results.json")
768+
769+ # Check if there are any issues
770+ if [ "$VALE_OUTPUT" = "[]" ] || [ "$(echo "$VALE_OUTPUT" | jq 'length')" -eq 0 ]; then
771+ echo "Vale check passed :No style issues found"
772+ echo "status=success" >> $GITHUB_OUTPUT
773+ echo "message=No style issues found in $FILE_COUNT files" >> $GITHUB_OUTPUT
774+ else
775+ # Count issues
776+ ISSUE_COUNT=$(echo "$VALE_OUTPUT" | jq 'length')
777+ echo "Vale found $ISSUE_COUNT style issues in $FILE_COUNT files"
778+
779+ # Group issues by file for better readability
780+ echo "$VALE_OUTPUT" | jq -r 'group_by(.Path) | .[] | .[0].Path + ":" + (. | length | tostring) + " issues"'
781+
782+ # Show details of first 10 issues
783+ echo "First 10 issues (detail):"
784+ echo "$VALE_OUTPUT" | jq -r '.[] | "\(.Path):\(.Line):\(.Column) - \(.Message) (\(.Check))"' | head -10
785+
786+ echo "status=warning" >> $GITHUB_OUTPUT
787+ echo "message=Found $ISSUE_COUNT style issues in $FILE_COUNT files" >> $GITHUB_OUTPUT
788+ echo "issues=$VALE_OUTPUT" >> $GITHUB_OUTPUT
789+ fi
790+ else
791+ echo "Warning :Vale produced invalid JSON output, treating as success"
792+ echo "status=success" >> $GITHUB_OUTPUT
793+ echo "message=Style check completed (JSON parsing issue)" >> $GITHUB_OUTPUT
794+ fi
756795else
757- echo "Valecheck was skipped or had issues "
796+ echo "No Valeresults file found, skipping processing "
758797echo "status=skipped" >> $GITHUB_OUTPUT
759- echo "message=Valecheck was skipped or had issues " >> $GITHUB_OUTPUT
798+ echo "message=No Valeresults to process " >> $GITHUB_OUTPUT
760799fi
761800
762801echo "::endgroup::"