ci: enhance GitHub Actions workflows with security and performance improvements #76
Workflow file for this run
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: Documentation Validation | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - "docs/**" | |
| - "**/*.md" | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| - "docs/**" | |
| - "**/*.md" | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| validate-mermaid: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install mermaid-cli | |
| run: npm install -g @mermaid-js/mermaid-cli | |
| - name: Validate Mermaid diagrams | |
| run: | | |
| if [ -f scripts/validate-mermaid.sh ]; then | |
| ./scripts/validate-mermaid.sh | |
| else | |
| echo "No Mermaid diagrams to validate" | |
| fi | |
| env: | |
| PUPPETEER_CONFIG: ${{ github.workspace }}/scripts/puppeteer-config.json | |
| lint-markdown: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Lint Markdown | |
| uses: DavidAnson/markdownlint-cli2-action@v15 | |
| with: | |
| globs: "**/*.md" | |
| config: ".markdownlint.json" | |
| docs-validation-summary: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| needs: [validate-mermaid, lint-markdown] | |
| if: always() | |
| steps: | |
| - name: Generate summary | |
| run: | | |
| { | |
| echo "## 📝 Documentation Validation Results" | |
| echo "" | |
| echo "| Check | Status |" | |
| echo "|-------|--------|" | |
| echo "| Mermaid Diagrams | ${{ needs.validate-mermaid.result == 'success' && '✅ Passed' || needs.validate-mermaid.result == 'skipped' && '⏭️ Skipped' || '❌ Failed' }} |" | |
| echo "| Markdown Linting | ${{ needs.lint-markdown.result == 'success' && '✅ Passed' || '❌ Failed' }} |" | |
| echo "" | |
| if [ "${{ needs.validate-mermaid.result }}" == "failure" ] || [ "${{ needs.lint-markdown.result }}" == "failure" ]; then | |
| echo "**Status**: ❌ Validation failed" | |
| echo "" | |
| echo "*Review the logs above for detailed error messages*" | |
| else | |
| echo "**Status**: ✅ All documentation validation checks passed" | |
| fi | |
| } >> "$GITHUB_STEP_SUMMARY" |