From 86641d3646bdf6553401490240f35ceb3973c714 Mon Sep 17 00:00:00 2001 From: Bruno Capuano Date: Thu, 12 Feb 2026 11:06:12 -0500 Subject: [PATCH] Remove validation workflows and markdown-to-pdf script --- .../validate-documentation-links.yml | 61 -------------- scripts/markdown-to-pdf.ps1 | 82 ------------------- 2 files changed, 143 deletions(-) delete mode 100644 .github/workflows/validate-documentation-links.yml delete mode 100644 scripts/markdown-to-pdf.ps1 diff --git a/.github/workflows/validate-documentation-links.yml b/.github/workflows/validate-documentation-links.yml deleted file mode 100644 index 0dcdce53..00000000 --- a/.github/workflows/validate-documentation-links.yml +++ /dev/null @@ -1,61 +0,0 @@ -name: Validate Documentation Links - -on: - pull_request_target: - branches: - - main - paths: - - '**.md' - push: - branches: - - main - -permissions: - contents: read - pull-requests: write - -jobs: - check-broken-paths: - runs-on: ubuntu-latest - steps: - - name: Checkout Repo - uses: actions/checkout@v3 - with: - ref: ${{ github.event.pull_request.head.sha }} - - name: Check broken Paths - uses: john0isaac/action-check-markdown@v1.1.0 - with: - command: check_broken_paths - directory: ./ - guide-url: 'https://github.com/microsoft/Generative-AI-for-beginners-dotnet/blob/main/CONTRIBUTING.MD' - github-token: ${{ secrets.GITHUB_TOKEN }} - - check-urls-locale: - runs-on: ubuntu-latest - steps: - - name: Checkout Repo - uses: actions/checkout@v3 - with: - ref: ${{ github.event.pull_request.head.sha }} - - name: Check URLs Country Locale - uses: john0isaac/action-check-markdown@v1.1.0 - with: - command: check_urls_locale - directory: ./ - guide-url: 'https://github.com/microsoft/Generative-AI-for-beginners-dotnet/blob/main/CONTRIBUTING.MD' - github-token: ${{ secrets.GITHUB_TOKEN }} - - check-broken-urls: - runs-on: ubuntu-latest - steps: - - name: Checkout Repo - uses: actions/checkout@v3 - with: - ref: ${{ github.event.pull_request.head.sha }} - - name: Check broken URLs - uses: john0isaac/action-check-markdown@v1.1.0 - with: - command: check_broken_urls - directory: ./ - guide-url: 'https://github.com/microsoft/Generative-AI-for-beginners-dotnet/blob/main/CONTRIBUTING.MD' - github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/scripts/markdown-to-pdf.ps1 b/scripts/markdown-to-pdf.ps1 deleted file mode 100644 index 11477f13..00000000 --- a/scripts/markdown-to-pdf.ps1 +++ /dev/null @@ -1,82 +0,0 @@ -param( - [Parameter(Position=0)] - [string]$Path = ".", - - [Parameter()] - [switch]$Recurse = $true, - - [Parameter()] - [string]$OutputDir -) - -function Write-Info($msg) { Write-Host "[md->pdf] $msg" -ForegroundColor Cyan } -function Write-Err($msg) { Write-Host "[md->pdf] $msg" -ForegroundColor Red } - -# Resolve path -$root = Resolve-Path $Path -Write-Info "Root: $root" - -# Verify npx availability -if (-not (Get-Command npx -ErrorAction SilentlyContinue)) { - Write-Err "npx is not available. Please install Node.js (https://nodejs.org)." - exit 1 -} - -# Create output directory if provided -if ($OutputDir) { - $outResolved = Resolve-Path -Path $OutputDir -ErrorAction SilentlyContinue - if (-not $outResolved) { - New-Item -ItemType Directory -Path $OutputDir -Force | Out-Null - $outResolved = Resolve-Path -Path $OutputDir - } - Write-Info "OutputDir: $outResolved" -} - -# Gather markdown files -$searchOpts = @{ Path = $root; Filter = "*.md"; File = $true; } -if ($Recurse) { $searchOpts.Recurse = $true } -$files = Get-ChildItem @searchOpts | - Where-Object { $_.FullName -notmatch "\\node_modules\\" } - -if ($files.Count -eq 0) { - Write-Err "No Markdown files found under $root" - exit 2 -} - -Write-Info "Found $($files.Count) Markdown file(s)." - -$errors = @() -foreach ($f in $files) { - $targetPdf = if ($OutputDir) { - $baseName = [System.IO.Path]::GetFileNameWithoutExtension($f.Name) - Join-Path $OutputDir "$baseName.pdf" - } else { - [System.IO.Path]::ChangeExtension($f.FullName, ".pdf") - } - - Write-Info "Converting: $($f.FullName) -> $targetPdf" - try { - # Use npx to run md-to-pdf without prompt - $cmd = "npx --yes md-to-pdf `"$($f.FullName)`"" - $null = Invoke-Expression $cmd - # md-to-pdf outputs in same folder by default; move if OutputDir specified - if ($OutputDir) { - $produced = [System.IO.Path]::ChangeExtension($f.FullName, ".pdf") - if (Test-Path $produced) { - Move-Item -Force -Path $produced -Destination $targetPdf - } - } - } - catch { - Write-Err "Failed: $($f.FullName) - $($_.Exception.Message)" - $errors += $f.FullName - } -} - -if ($errors.Count -gt 0) { - Write-Err "Completed with $($errors.Count) error(s)." - foreach ($e in $errors) { Write-Err " - $e" } - exit 3 -} - -Write-Info "All conversions completed successfully." \ No newline at end of file