(test) Add Markup AI workflow #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
| permissions: | |
| contents: read | |
| pull-requests: write | |
| statuses: write | |
| name: PR Quality Check | |
| on: | |
| pull_request: | |
| paths: | |
| - '**.mdx' | |
| - '**.md' | |
| - '.vale/**' | |
| - '.vale.ini' | |
| - '!**/changelog/**' | |
| jobs: | |
| quality-gate: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| # Temporarily rename .mdx to .md | |
| - name: Prepare MDX files | |
| run: | | |
| # Store original names | |
| find . -name "*.mdx" > /tmp/mdx_files.txt | |
| # Rename to .md | |
| while read file; do | |
| mv "$file" "${file%.mdx}.md" | |
| done < /tmp/mdx_files.txt | |
| - name: Quality Analysis | |
| id: analysis | |
| uses: markupai/content-guardian-action@v1 | |
| with: | |
| markup_ai_api_key: ${{ secrets.MARKUP_AI_API_KEY }} | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| dialect: "american_english" | |
| style-guide: "microsoft" | |
| tone: "technical" | |
| # Rename back to .mdx | |
| - name: Restore MDX extensions | |
| if: always() | |
| run: | | |
| while read file; do | |
| md_file="${file%.mdx}.md" | |
| if [ -f "$md_file" ]; then | |
| mv "$md_file" "$file" | |
| fi | |
| done < /tmp/mdx_files.txt | |
| - name: Check Quality Score | |
| run: | | |
| results='${{ steps.analysis.outputs.results }}' | |
| echo "$results" |