feat(docs): add Vale style checking and docs workflow improvements #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docs Shared Example | |
on: | |
pull_request: | |
types: [opened, synchronize, reopened] | |
paths: | |
- 'docs/**' | |
- '**.md' | |
- '.github/workflows/docs-shared-example.yaml' | |
- '.github/docs/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/docs/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 |