Model Reference Validation #3
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
| # Copyright (c) 2026 Microsoft Corporation. All rights reserved. | |
| # SPDX-License-Identifier: MIT | |
| name: Model Reference Validation | |
| on: | |
| schedule: | |
| # Weekly scan: Wednesdays at 08:00 UTC | |
| - cron: '0 8 * * 3' | |
| pull_request: | |
| paths: | |
| - '.github/agents/**/*.agent.md' | |
| - '.github/prompts/**/*.prompt.md' | |
| - 'scripts/linting/model-catalog.json' | |
| - 'scripts/linting/Test-ModelReferences.ps1' | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| validate-models: | |
| name: Validate Model References | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Setup PowerShell modules | |
| uses: ./.github/actions/setup-ps-modules | |
| - name: Refresh model catalog from GitHub docs | |
| shell: pwsh | |
| run: | | |
| & scripts/linting/Update-ModelCatalog.ps1 -CatalogPath scripts/linting/model-catalog.json | |
| - name: Detect catalog drift from committed version | |
| shell: bash | |
| run: | | |
| if ! git diff --quiet scripts/linting/model-catalog.json; then | |
| echo "::warning::model-catalog.json differs from committed version after upstream refresh. Run 'npm run lint:models:refresh' locally and commit the updated catalog." | |
| echo "### Catalog drift detected" >> "$GITHUB_STEP_SUMMARY" | |
| git diff --stat scripts/linting/model-catalog.json >> "$GITHUB_STEP_SUMMARY" | |
| fi | |
| - name: Validate model references against catalog | |
| id: validate | |
| shell: pwsh | |
| run: | | |
| New-Item -ItemType Directory -Force -Path logs | Out-Null | |
| & scripts/linting/Test-ModelReferences.ps1 -OutputPath logs/model-validation-results.json | |
| - name: Upload results | |
| if: always() | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: model-validation-results | |
| path: | | |
| logs/model-validation-results.json | |
| retention-days: 30 | |
| if-no-files-found: ignore | |
| - name: Report catalog drift | |
| if: always() | |
| shell: pwsh | |
| run: | | |
| $catalog = Get-Content -Path scripts/linting/model-catalog.json -Raw | ConvertFrom-Json | |
| $retiring = @($catalog.models | Where-Object { $_.status -eq 'retiring' }) | |
| if ($retiring.Count -gt 0) { | |
| Write-Host "Models marked as retiring:" -ForegroundColor Yellow | |
| foreach ($m in $retiring) { | |
| Write-Host " - $($m.name) (retiring: $($m.retiredDate))" -ForegroundColor Yellow | |
| } | |
| echo "::warning::$($retiring.Count) model(s) are marked as retiring. Update agent/prompt references." | |
| } else { | |
| Write-Host "No models are retiring. All references current." -ForegroundColor Green | |
| } |