Skip to content

feat(docs): add Vale style checking and docs workflow improvements #17370

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

Closed
wants to merge 10 commits into from
Prev Previous commit
Next Next commit
Add test workflow
  • Loading branch information
EdwardAngert committed Apr 9, 2025
commit 6a7a2bc7e73b0964aad6699fdaaa6ba6afd05b1c
72 changes: 72 additions & 0 deletions .github/workflows/test-docs-shared.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Docs Shared Example
on:
pull_request:
types: [opened, synchronize, reopened]
paths:
- 'docs/**'
- '**.md'
- '.github/workflows/docs-shared-example.yaml'
- '.github/actions/docs-shared/**'

permissions:
contents: read

jobs:
docs-check:
name: Check Documentation
runs-on: ubuntu-latest
permissions:
pull-requests: write # needed for commenting on PRs
steps:
- name: Harden Runner
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
with:
egress-policy: audit

- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0

- name: Get PR info
id: pr_info
run: |
set -euo pipefail
PR_NUMBER=${{ github.event.pull_request.number }}
echo "PR_NUMBER=${PR_NUMBER}" >> $GITHUB_ENV
echo "PR_NUMBER=${PR_NUMBER}" >> $GITHUB_OUTPUT
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Process Documentation
id: docs-shared
uses: ./.github/actions/docs-shared
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
docs-dir: docs
include-md-files: "true"
check-links: "true"
lint-markdown: "true"
format-markdown: "true"
generate-preview: "true"
post-comment: "true"
pr-number: "${{ env.PR_NUMBER }}"
fail-on-error: "false" # Set to false for this example to show all checks

- name: Debug Outputs
run: |
echo "Has changes: ${{ steps.docs-shared.outputs.has_changes }}"
echo "Preview URL: ${{ steps.docs-shared.outputs.preview_url }}"
echo "Manifest changed: ${{ steps.docs-shared.outputs.manifest_changed }}"
echo "New docs found: ${{ steps.docs-shared.outputs.has_new_docs }}"

# Only display errors if there are any
if [ "${{ steps.docs-shared.outputs.lint_results }}" != "" ]; then
echo "Linting issues found:"
echo "${{ steps.docs-shared.outputs.lint_results }}"
fi

if [ "${{ steps.docs-shared.outputs.format_results }}" != "" ]; then
echo "Formatting issues found:"
echo "${{ steps.docs-shared.outputs.format_results }}"
fi
Loading